|
Rockbox mail archiveSubject: source suggestings (was missing win32 file)source suggestings (was missing win32 file)
From: Greg Haerr <greg_at_censoft.com>
Date: Wed, 12 Jun 2002 01:20:46 -0700 > In my opinion, compiling two different executables is good. The features of the two versions may be quite similar at the moment, but they will diverge more and more the further we go. Ok. In looking at the code in say, apps/tree.c, there's a lot of #if HAVE_RECORDER_KEYPAD etc, which serves to build the same UI with different keystrokes. My idea is that, if this app code is shared, then the #ifdef's could be removed by using only BUTTON_{UP,DOWN,LEFT,RIGHT} rather than the current BUTTON_LEFT for the recorder version and BUTTON_STOP for the player version. The apps code could use just UP,DOWN,LEFT,RIGHT, and get rid of the PLAY and STOP values that are player-specific and happen to be shared with UP and DOWN. This removes all #ifdefs and allows the applications code to be written for player, recorder, and simulator in a much more understandable fashion. If the apps code will diverge significantly between the recorder and player versions, then perhaps there ought to be an apps/recorder and apps/player directory where the main code for the applications will sit. Then all other code would be called library-style from other directories. This is somewhat hard to explain, it's just intended to be a helpful comment from somebody who's just taken a quick look at the entire source tree. I can submit a patch for this whole idea if you like. > We don't want the target firmware to contain code that we don't use, and therefore we probably also don't want the simulators to do it since that would make them less "target-like". I agree. The init code for the simulator and target versions probably needs to be consolidated as well then. That will remove more #ifndef SIMULATOR calls. Regards, Greg I agree, though, that the #ifdefs are sometimes more messy than I would like, so ideas to make the code simpler are encouraged. -- BjörnReceived on 2002-06-12 Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |