看板 Soft_Job 關於我們 聯絡資訊
啊!時代的眼淚。MS COM(component object model). 你先找一下資料,看COM是什麼東西。 第一張圖只是把ptr function call變成比較清楚的function名稱。無特殊功能。 第二張圖ifdef只是看要用macro text substitution還是真function. debug purpose? --------------------------------------------------------------------------- 要understand legacy code其實是有方法的。 不是top-down從main追流程。要bottom-up。記得演算法就是divide and conquer. Fred Brooks說"Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious." 首先把所有struct, global variable列出來。盡可能寫出它們的用途. 然後class data同樣寫出。 第二,找出最簡單的function, 除了c library/win library, 沒有call其他function.註 解功能。 第三,找出function只call已經註解的function. 第四,repeat 3, 直到所有function都註解了。 第五,從main開始trace.很簡單的完成任務。 ---------------------------------------------- 因為com的原因,你會有很多program. 一樣divide and conquer. 沒有depend on其他com(program)的program先解析。 然後解析只depend已經解析過的program. ---------------------------------------------- 你可以一邊解析一邊port到java. mindmap可能可以幫助你了解dependencies. -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.167.153.229 ※ 文章網址: https://www.ptt.cc/bbs/Soft_Job/M.1520168750.A.184.html
a88241050: 好哦,謝謝你 03/04 21:29
s89162504: 感謝樓主 下次看舊的code時來練習 03/04 22:47
jj0321: 好人推推 03/04 23:15
louisalflame: 推 03/05 01:02
dannypsnl: 推 03/05 01:15
GLaDOS1105: 推 03/05 17:45