From: Max H. <ma...@qu...> - 2001-10-10 08:29:33
|
At 14:14 Uhr +1000 10.10.2001, ni...@in... wrote: > > OK, got the source for the OS X version, thanks. > > Thanks for looking through all my hacky source code, Max! Thanks for creating it in the first place :) BTW, a lot of files have no legal header at all. You should insert one (even if it is just the default ProjectBUilder header) with your name and the creation date. if you want to GPL something, then add also the GPL into the header. > >> I am already using 10.1 + 10.1 dev tools, which meant I first had a >> hard time using the ObjC parts - the problem is that several files >> (e.g. main.h) use C++ constructs, > > > Hmmm. The only C++ism I could see in main.h was 'bool', >which is defined by main_MacOSX.h. As soon as I can get a copy >of 10.1, I will re-check compilation. Well it turned out that alot of this C++ism was introduced in the CVS version. My fault, sorry. > > >... >> The simple fix was to change the suffices to .mm which turns >> on the ObjectiveC++ compiler on OS X 10.1 > > If it is going to be built with the Obj-C++ compiler, >then all the glue functions in cpp_glue_MacOSX.{cpp,h} can go. Yeah. But this probably should wait till you have 10.1 + dev tools, too :) [...] > > Oh, and I am not so convinced that this is good style: >> >> void errorPanel (const char *text), >> warningPanel (const char *text); > > What is bad style? The function names? The multi-line decl? >The actual purpose of the functions? Sorry I was not clear :) Well, the multi-line decl is something I find very unusal. However, I don't see how it would be harmful right now, so if you like it, keep it :) [...] > > ##################################### >> In Emulator.m/.h, you use a variable called "clock" which somehow >> clashes with the unix function of the same name somehow. > > Hmm. It doesn't clash under 10.0. Anyway, I have called it >'RTC', and renamed clockInterrupt() as RTCinterrupt(). It worked ok unchanged in conjunction with the release version of Basilisk. However, this is becasue the CVS version seems to include some extra headers, which define the conflicting symbol. [...] >... >> ##################################### >> In Emulator.m. method SpeedChange, you call >> >> [redraw changeIntervalTo:redrawDelay * 1e6 >> units:NNmicroSeconds ]; >> >> However, this doesn't make sense to me looking at how >> changeIntervalTo:units: is implemented - why don't you simply change >> the first parameter of that function to accept a double? then change >> the above mentioned call to >> >> [redraw changeIntervalTo:redrawDelay >> units:NNSeconds ]; > > The NNTimer class uses nanosleep, which uses integers to set >its delay period. I decided to stick with passing integers into its >methods, hence the need to send the delay as a multiple of a small >time delta. > > >... >> Could you give me a quick hint what NNThread and NNTimer are needed >> for - what advantage do they have over NSThread and NSTimer? > > They are not, strictly speaking, _needed_. They are mainly >an elegance thing. I created them to simplify all the pthread stuff >in main_unix.cpp. Their history: > [..cut off explanation of NNThread/NNTimer...] > > Now, instead of all this, I could have used one NSThread, >which called a modified main() from main_unix.cpp, and have the GUI >thread locate the Mach kernel thread of that main() and manipulate >its state, but that just felt really ugly. Much tidier to individually >create the threads and timers from Obj-C, and then toggle their state >all at once. OK, that is all fine by me. I didn't want to suggest you switch to NS* anyway, I was more interested in understanding the reasons without spending hours over the code :) Max -- ----------------------------------------------- Max Horn Software Developer email: <mailto:ma...@qu...> phone: (+49) 6151-494890 |