Bug 2890 - Code cleanup to reduce the number of files for q3asm
Status: RESOLVED WONTFIX
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: All All
: P5 enhancement
Assignee: Tremulous Bugs
QA Contact:
URL:
Depends on:
Blocks: 3089
 
Reported: 2006-10-06 20:32 EDT by Wolf Armstrong
Modified: 2009-10-17 19:50:02 EDT
3 users (show)

See Also:


Attachments
q3asm.h (4.38 KB, text/plain)
2006-10-06 20:33 EDT, Wolf Armstrong
q3asm.c (41.31 KB, text/plain)
2006-10-06 20:33 EDT, Wolf Armstrong
Makefile (596 bytes, text/plain)
2006-10-06 20:34 EDT, Wolf Armstrong

Description Wolf Armstrong 2006-10-06 20:32:40 EDT
I was bored, so I started looking through the q3asm code and realized how much of the code in the cmdlib files wasn't actually being used, so I went through and reduced things to one single pair of files at this point. The code got cleaned up in a couple of places by this, but mostly it removed a lot of unused/unreachable code and dead-end codepaths. Since the diff's would be rather monstrous, I'll attach the new q3asm.c, q3asm.h, and Makefile directly since this work can remove all other files in the src/tools/asm directory except those three.
Comment 1 Wolf Armstrong 2006-10-06 20:33:44 EDT
Created attachment 1106 [details]
q3asm.h
Comment 2 Wolf Armstrong 2006-10-06 20:33:59 EDT
Created attachment 1107 [details]
q3asm.c
Comment 3 Wolf Armstrong 2006-10-06 20:34:14 EDT
Created attachment 1108 [details]
Makefile
Comment 4 Tim Angus 2007-09-20 10:54:28 EDT
This probably won't apply anymore.
Comment 5 Wolf Armstrong 2007-09-20 20:36:52 EDT
(In reply to comment #4)
> This probably won't apply anymore.

Unless there have been modifications to the trunk/src/tools/asm directory that aren't on the icculus.org SVN repository, this set of files still replaces the entire dirctory contents.
Comment 6 Ryan C. Gordon 2009-09-14 18:51:45 EDT
I'm inclined to not apply this patch; it's not really broken, so I don't want to make serious changes. If this was just trimming, that'd be good, but this patch is an awful lot of surgery.

--ryan.
Comment 7 Wolf Armstrong 2009-09-14 19:36:14 EDT
(In reply to comment #6)
> I'm inclined to not apply this patch; it's not really broken, so I don't want
> to make serious changes. If this was just trimming, that'd be good, but this
> patch is an awful lot of surgery.
> 
> --ryan.

Would you prefer I re-submit it as a series of incremental patches to remove the dead-end code paths and what-not in more bite-sized chunks?

Or is any code clean-up patch to the src/tools/asm directory going to simply be rejected no matter how I format them? I've waited patiently for 3 years, suddenly having 'WONTFIX' slammed in my face kinda stings with such a vague reason of "it's not really broken" when there's a crapton of stuff in that directory that has no business being there.
Comment 8 Wolf Armstrong 2009-09-15 23:06:33 EDT
Would you prefer I re-submit it as a series of incremental patches to remove
the dead-end code paths and what-not in more bite-sized chunks?

Or is any code clean-up patch to the src/tools/asm directory going to simply be
rejected no matter how I format them? I've waited patiently for 3 years,
suddenly having 'WONTFIX' slammed in my face kinda stings with such a vague
reason of "it's not really broken" when there's a crapton of stuff in that
directory that has no business being there.
Comment 9 Tim Angus 2009-09-16 05:37:14 EDT
You haven't actually submitted any patches, so it's difficult to see what you're changing. It looks like you're collapsing all the headers down into fewer files? Is that all or are there functional changes too?
Comment 10 Ryan C. Gordon 2009-09-16 09:57:07 EDT
The first red flag was when I diffed q3asm.c against the new version and saw this...
 
-	end = I_FloatTime ();
+	end = (double)time(NULL);
 	report ("%5.0f seconds elapsed\n", end-start);

...while that line isn't all that important in itself, it raised a few red flags:

- Replacing existing infrastructure with platform calls isn't an improvement, it's just a code reduction.
- Replacing existing code with incompatible code (time() returns seconds, not sub-seconds) seems sloppy at best.

Yes, I know I_FloatTime() currently has the sub-second code commented out, but that's not the point. There's removing dead code, and there's this. Scalpels and hatches.


Also, this file is out of date with several fixes that are in svn. This isn't your fault, since this file has been sitting in Bugzilla for ages, but it makes it more difficult to apply it now.

And finally, I don't see the value in crunching this down into one file anyhow.

If there's some dead code to remove, I'm not against that, but we don't have to be overly aggressive about it.

--ryan.
Comment 11 Ryan C. Gordon 2009-09-16 09:57:55 EDT
(er...typo, sorry: "hatchets" not "hatches".)

--ryan.
Comment 12 Tim Angus 2009-10-17 19:50:02 EDT
I think we're happy with the status quo.