|
Post by tisselian on Jan 9, 2009 13:23:32 GMT
Hi here I am again: I think there are some functions wich do nothing or are never used in the src, for instance JE_loadShapeFile or JE_loadNewShapeFile in nortvars files... and even JE_wipeKey: void JE_wipeKey( void ) { // /!\ Doesn't seems to affect anything. } Are they in the code for some particular reason? If not maybe they can be cleaned up!
|
|
|
Post by atlasdark on Jan 9, 2009 21:25:37 GMT
Isn't memory management manual? If so, could it be related to such?
|
|
|
Post by tisselian on Jan 10, 2009 17:35:42 GMT
Isn't memory management manual? If so, could it be related to such? Well, but if I comment those lines everything functions well anyway : I think maybe those functions could have been left there during porting from Pascal to C, but they are completely unuseful (as the comment itself states, for example, in JE_wipeKey). What do the code owners tell about this?
|
|
|
Post by atlasdark on Jan 10, 2009 18:49:16 GMT
No references on search engines (save for code snippets from OpenTyrian), so I'm assuming its either leftover, a declaration, a user-defined function, or just plain obsolete.
|
|
|
Post by tisselian on Jan 10, 2009 19:34:34 GMT
No references on search engines (save code snippets from OpenTyrian), so I'm assuming its either leftover, a declaration, a user-defined function, or just plain obsolete.
|
|
|
Post by Mindless on Jan 10, 2009 19:45:11 GMT
that function is leftover from the original, non-SDL input system. it will probably be removed in the future
|
|
|
Post by yuriks on Jan 11, 2009 4:11:53 GMT
Some of the other are simply unused. The code we received also had lots of code for some editors, and also obsolete code from old versions.
|
|
|
Post by alexander on Jan 26, 2009 11:31:19 GMT
A quick scan with a call function builder reveals that effectively JE_wipeKey is completely useless. It can be removed safely. In addition to this dead code is also present here: animlib.c/.h -> only stubs as implementations and no calls. error.c -> JE_outputString and JE_DetectCFG are dead code mainint.c -> JE_func is dead code. JE_handleChat is called only once and does nothing tyrian2.c -> JE_drawJoystick is dead code. As far as the cleanup goes, I can easily do it and provide a patch if necessary ( there are a number of cases in which a computer science engineering master degree comes in handy ).
|
|
|
Post by Mindless on Jan 26, 2009 21:21:44 GMT
patches are indeed welcome
|
|
|
Post by alexander on Jan 29, 2009 10:03:30 GMT
Since I found a couple of other dead function chains (a good diff between objdumps makes wonders on dead code ) I was thinking: on which version shall I submit patches against? Is the CVS for classic stable enough to start the cleanup or will it undergo changes in the near future?
|
|
|
Post by Mindless on Jan 29, 2009 14:16:37 GMT
Since I found a couple of other dead function chains (a good diff between objdumps makes wonders on dead code ) I was thinking: on which version shall I submit patches against? Is the CVS for classic stable enough to start the cleanup or will it undergo changes in the near future? SVN of Classic usually gets only a few changes per month, so making patches shouldn't be too difficult. If something does change, SVN should be able to handle merging in the changes.
|
|
|
Post by alexander on Jan 29, 2009 17:30:11 GMT
ok , great. By the way , in order to speed up a bit the code inspection, may I know if you used any automated pascal to C translation tools or when you ported the application? Another useful thing would be knowing if in the original codebase the gotos were already present.
|
|
|
Post by Mindless on Jan 30, 2009 1:30:58 GMT
By the way , in order to speed up a bit the code inspection, may I know if you used any automated pascal to C translation tools or when you ported the application? None, everything was ported by hand; bunches of it was assembly to begin with. Another useful thing would be knowing if in the original codebase the gotos were already present. Probably, I can't imagine we added any. Edit: Actually, most of the gotos might be assembly jumps that I couldn't logically fit into other types of code blocks.
|
|
|
Post by alexander on Jan 30, 2009 10:04:15 GMT
None, everything was ported by hand; bunches of it was assembly to begin with. Probably, I can't imagine we added any. Edit: Actually, most of the gotos might be assembly jumps that I couldn't logically fit into other types of code blocks. Ouch! Ok, not my best case scenario , but anyway that's fine Nice work dealing with those issues, btw Just another info : are you planning on porting also the ship editor? there is some code which is used only there, therefore I don't know if it must be considered alive or dead.
|
|
|
Post by Mindless on Jan 30, 2009 14:25:38 GMT
Just another info : are you planning on porting also the ship editor? there is some code which is used only there, therefore I don't know if it must be considered alive or dead. At one point we were; I think that's been dropped off the TODO list though.
|
|