You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(2) |
Feb
(13) |
Mar
(3) |
Apr
(9) |
May
(5) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(6) |
Oct
(2) |
Nov
(3) |
Dec
|
2002 |
Jan
(5) |
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(13) |
Jul
(2) |
Aug
(3) |
Sep
(8) |
Oct
|
Nov
(1) |
Dec
(3) |
2003 |
Jan
(13) |
Feb
(9) |
Mar
(4) |
Apr
(5) |
May
|
Jun
(1) |
Jul
(3) |
Aug
|
Sep
(1) |
Oct
|
Nov
(8) |
Dec
(9) |
2004 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
(3) |
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
(3) |
Nov
|
Dec
(1) |
2005 |
Jan
|
Feb
(7) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Andrew G. <ag...@em...> - 2003-03-02 16:11:50
|
For some reason a lot of my messages are not showing up in the zoolib-dev archive at <http://sourceforge.net/mailarchive/forum.php?forum=zoolib-dev>. Just sending this to see if it's a transient problem. A+ -- Andrew Green mailto:ag...@em... Electric Magic Co. Vox/Fax: +1 (408) 907 2101 |
From: Andrew G. <ag...@em...> - 2003-02-28 02:37:38
|
I'm going to be checking in changes to ZTuple. This message explains the motivation for the changes, and a little of how to take advantage of them. In many situations no application changes will be necessary. If you use AddXXX, or GetXXX with an index, or if you have serialized tuples then you'll need to read this in more detail. I put together ZTuple when I was living on Downey Street in San Francisco, so that must have been 1996. That version had a rather neat API that overloaded operator[] to return a value reference, which had assignment and conversion operators for each of the supported types. To exactly specify the type to be stored or retrieved one simply used appropriate casts. Very neat, but actually quite unpleasant to use because we'd end up using casts all the time just be sure of what was happening: theTuple["fred"] = 1; is a bit ambiguous to the reader -- which of the standard int types will the compiler map an unadorned '1' to? To be sure we'd have to write: theTuple["fred"] = int32(1); Ugh! Porting ZooLib to BeOS a couple of years later inspired the revamping of ZTuple to use an API similar to BeOS's BMessage, which is the API we have now. It's less sophisticated, but much more predictable in day to day use. My original idea was that ZTuple/ZMessage would have a swappable underlying representation, and that on BeOS we'd be able to use BMessage as the actual storage medium (on the basis that the OS vendor will have optimized the performance more than I'm capable of). So having an exactly equivalent API was useful. BeOS did not have a system-wide representation of lists of things, at least as far as BMessage and its supported types were concerned. So to allow the storage of lists of values under a single property name their API has an additional index parameter on getter methods. The normal setter method was AddXXX, which would add the passed in value to the list stored under a particular name, establishing the name if it wasn't already there. ReplaceXXX and RemoveXXX filled out the list-like API. However, it's still an API that's not as rigorous as I'd like. There's no difference between a property with a single value and a property with a list of values containing a single item, they're represented identically. In some situations that's actually a nice thing. But there's no simple way to establish a property with an empty list of values, so code tends to treat the absence of a property as equivalent to an empty list, which may not always be what's wanted. For example if you want to communicate that something was looked for but nothing was found, vs not having looked for the thing at all. In addition, calling AddXXX(theName, someXXX) on a tuple which already contains theName results in someXXX getting appended to the values already there. How can you be sure that what you're putting in place is what you'll later retrieve? Well, on BeOS, you have to mess about with code that invokes FindXXX, then calls ReplaceXXX or AddXXX appropriately. To ameliorate this particular weakness I enhanced the API with SetXXX methods that unconditionally overwrite whatever may already be stored under a name with a single value -- SetXXX guarantees that after it's called there will be a property with that single value. And that's the API I've tried to use unless I'm really expecting to be building a list. I've recently gone back through ZooLib and ensured that I'm not doing an AddXXX when I really mean SetXXX. Although ZTuple can store and work with lists of values, *we* can't treat lists of values generically as we do with the other types ZTuple supports. So this: theTuple.SetValue("theName", otherTuple.GetValue("otherName")); doesn't transfer every value stored by otherTuple under "otherName" to theTuple under "theName" -- in fact it copies only the first value to theTuple. The reason for this is that it's ZTuple that's doing the vector stuff rather than ZTupleValue, and ZTupleValue is what's returned by ZTuple::GetValue. The original (circa 1996) ZTupleValue implementation *was* able to store various primitive types, strings, tuples and vectors of ZTupleValues. So treating lists polymorphically with other types was easy, and ZTuple didn't get involved. With the impending profusion of ZTuple-based code it seemed time to clear up all these things that have been bugging me. So I've revamped ZTupleValue and ZTuple, maintaining the parts of the Get/Set API that's proven effective, having ZTupleValue do the work of storing vectors of other ZTupleValues, and losing the AddXXX API in favor of a more or less equivalent suite of AppendXXX methods. AppendXXX will establish a name if it's not already present. If it is present and the stored value is already a vector then the passed in value is simply appended to it. If it's not a vector, or doesn't exist at all, then we establish a value which is a vector with a single entry, the value that was passed in. So where you might have had a loop: for (int x = 0; x < 10; ++x) theTuple.AddInt32("aName", x); you can do this: for (int x = 0; x < 10; ++x) theTuple.AppendInt32("aName", x); and get exactly the same effect, unless the property "aName" already had a non-vector value in it. In actual use this doesn't happen. Or at least it won't if the informal protocol by which tuples are build up and consumed is sufficiently well defined. It really should be the case that a particular property is expected to have multiple values, or its expected to have exactly one. For pre-existing code that wants to be able to deal with vectors of values and single values identically, perhaps because the tuples are coming from permanent storage and contain vectors of values that just happened to have only a single value, we have a handful of GetXXXAt methods. We might need to expand them out to include all data types, but for now I've put in place only the ones I've seen used. The companion method to GetXXXAt is CountValuesAt: for (int x = 0; x < theTuple.CountValuesAt("aName"); ++x) { int32 anInt32 = theTuple.GetInt32At("aName", x); ... } [Of course it's better to get the count once at the beginning, and to convert the name into a property number, but this is just for expositional purposes.] The 'more modern' equivalent, where we're being more rigorous in constructing tuples and extracting data from them, we'd do something like this: theTuple.SetEmptyVector("aName"); for (int x = 0; x < 10; ++x) theTuple.GetVectorMutable("aName").push_back(x); or vector<ZTupleValue>& theVector = theTuple.SetEmptyVector("aName"); for (int x = 0; x < 10; ++x) theVector.push_back(x); or indeed any STL container-stuffing algorithm could be used to populate theVector. To extract data: const vector<ZTupleValue>& theVector = theTuple.GetVector("aName"); for (vector<ZTupleValue>::const_iterator i = theVector.begin(); i != theVector.end(); ++i) { int32 theInt = (*i).GetInt32(); ... } NOTE: GetVector and GetVectorMutable return const and non-const *references*, so you must not make mutating changes to the enclosing tuple that could invalidate the references. To support reading of tuples and tuplevalues that are already in backing store ZTuple and ZTupleValue have FromStreamOld methods that will do the right thing with old tuples -- singleton values come in as singleton values, multiple values come in as vectors. I've extended the ZType enum. The new values are eZType_Vector (of course), eZType_ID and eZType_Type. eZType_ID holds a 64 bit value, and can be distinguished from a regular 64 bit integer (necessary for tuplestores). eZType_Type is a confusing name, but is used to indicate that the content of a ZTupleValue is a ZType enum. With this we're able to describe the structure of a tuple using a tuple. In summary, we've still got the same functionality as before, albeit with name changes to make sure existing code fails to compile and can be updated to use the new API if appropriate. We're also able to apply STL algorithms to tuple contents in a way that wasn't possible before. The specification of a tuple now more closely matches associative arrays in other languages, in particular Cocoa's dictionaries. A+ -- Andrew Green mailto:ag...@em... Electric Magic Co. Vox/Fax: +1 (408) 907 2101 |
From: Michael D. C. <cra...@go...> - 2003-02-23 01:37:11
|
I'm looking for websites that will post links to ZooLib's website. For example, Cprogramming.com just accepted a link, which they have at: http://www.cprogramming.com/cgi-bin/cdir/Cdirectory.cgi?action=Category&CID=8&Page=2 Having websites link to ZooLib doesn't just draw websurfers to our site, it also will help ZooLib rank higher in the search engines. Some search engines (such as google) will rank a site higher if it has lots of links because they figure the page is more interesting to people. I've submitted proposals to a couple technical publishers about having them publish dead-tree editions of The ZooLib Cookbook. But both of them told me they would need to sell 10,000 copies to recoup their investment. One of them estimated that 1/10th of the people that download an Open Source package will buy its book, so I expect that before a publisher will accept my proposal, ZooLib needs to have 100,000 downloads. That means I need to do a lot more to promote it. If we had that many downloads, it would probably also attract a lot of developers to help out with developing ZooLib itself. Linux people usually look for software on http://freshmeat.net/ BeOS people will look at http://www.bebits.com/ But where will Windows and Mac people look? So suggest to me any websites that you think might be willing to give us a link, and I'll submit ZooLib. Alternatively you can submit the link yourselves. It would also be a big help if you could link to ZooLib from your personal home pages and weblogs. It looks like Andy got http://www.zoolib.org/ set up to redirect to the sourceforge site so that's probably the best URL to use. Also, I've been talking with Andy for a while about issuing a proper release to ZooLib soon. A lot of work has been done since the 0.8.1 release, but most users don't want to get the code from CVS. The main thing I need to do is to make sure all the demo code builds cleanly in all the supported compilers on all the supported platforms. Once a new release is issued, I plan to write an article about ZooLib and submit it to http://www.kuro5hin.org/ I've posted a couple articles there before which were well received. I think if I can get the article accepted, it should draw a lot of interest. We will also be posted briefly on the front pages of bebits and freshmeat. Regards, Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Kyle W. <qui...@ho...> - 2003-02-13 11:57:46
|
Hello, My name is Kyle Wilt. I've recently been introduced to zoolib thanks to Mike Crawford and I have a question about the multithreading used. I noticed that every standalone window (at least in WIN32) has it's own thread. I was wondering what the reasoning was behind this. I don't necessarily agree or disagree with this method, I'm just curious. Thanks. _________________________________________________________________ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail |
From: Andrew G. <ag...@em...> - 2003-02-11 16:10:30
|
On Monday, Feb 10, 2003, at 15:16 America/Mexico_City, Michael D. Crawford wrote: > I ended up doing a custom control from scratch, it came out pretty > nice. > > My "IntegerSetting" has two little arrowheads, up and down, that > adjust the value which is reported as an integer. > > I have a mousetracker on it so it auto-increments if you hold the > mouse down but pauses if you move the mouse outside the arrowhead > region. > > I'll try to cook up some plausible demo app to use it in and check it > into the samples, and use it to talk about custom controls for The > ZooLib Cookbook. Did you specifically choose not to use an instance of ZUILittleArrows (and its platinum, win32 & appearance variations), or is just such a dumb name that it didn't make sense that it would be the paired up/down arrow control? A+ -- Andrew Green mailto:ag...@em... Electric Magic Co. Vox/Fax: +1 (408) 907 2101 |
From: Michael D. C. <cra...@go...> - 2003-02-10 22:15:13
|
I ended up doing a custom control from scratch, it came out pretty nice. My "IntegerSetting" has two little arrowheads, up and down, that adjust the value which is reported as an integer. I have a mousetracker on it so it auto-increments if you hold the mouse down but pauses if you move the mouse outside the arrowhead region. I'll try to cook up some plausible demo app to use it in and check it into the samples, and use it to talk about custom controls for The ZooLib Cookbook. Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Andrew G. <ag...@em...> - 2003-02-10 20:58:35
|
On Sunday, Feb 9, 2003, at 00:52 America/Mexico_City, Michael D. Crawford wrote: > If I make a button with ZUIFactory::Make_ButtonPush, it looks OK under > Mac OS 9, but when drawn in the Aqua appearance under OS X, the buttom > couple of pixels is always cut off. > > It looks like some adjustment for the size needs to be done under the > case of OS X. > > I'm happy to try to fix this, but I've never done any Appearance > Manager programming. Maybe if someone could give me some tips on what > I need to do, I can fix it. I've only just switched to living in MacOS X, so this is bugging me on a daily basis too. As I remember from the time I looked at this, the problem is that the bounds we're passing to DrawThemeButton is the clipped boundary of the button -- it's actually drawing outside those bounds, and so we have to compensate for that by reducing the requested bounds. It was worse in 10.1 when there was even more significant stuff outside the bounds proper. I don't have a proper solution right now -- we're already doing the wrong thing by mucking with the bounds by 3 pixels on each edge when its for a default button because the old appearance manager wouldn't take the default ring into account regardless of the settings of the ThemeButtonDrawInfo struct we pass in to GetThemeButtonContentBounds. A+ -- Andrew Green mailto:ag...@em... Electric Magic Co. Vox/Fax: +1 (408) 907 2101 |
From: Andrew G. <ag...@em...> - 2003-02-10 20:52:02
|
On Saturday, Feb 8, 2003, at 18:19 America/Mexico_City, Michael D. Crawford wrote: > I've been trying to put a slider in my window but nothing shows up. > > Looking into the code, trying to draw it calls through to > RenderSlider. This seems to only be defined for the platinum renderer > but the function body is empty. > > Is the slider not yet implemented or am I just missing something? > > If it's not there yet I can do a scroll bar for now. I'll try to > implement a slider and contribute it. I did one on a previous > project. > > I've been such a slacker the last couple of weeks it's taken me > several days to figure out where my slider is at. I didn't have anything that needed a slider, so I never got around to implementing it. The intent was that it would have the same protocol as a scrollbar (they both implement ZUIRange), but without some actual test cases I was never able to define an appropriate mechanism and interface for defining and handling tickmarks and labels attached to those tickmarks -- one might need regularly spaced, exponentially spaced, randomly or data-driven spacing etc. So that's why it's not there. The main task, for something fully general, is identifying the state needed to back a slider (count and location of ticks, labels at those ticks), and appropriate representations for that state. The dynamic behavior options (snapping to tickmarks or smoothly scaling for example) is the responsibility of the responder. A+ -- Andrew Green mailto:ag...@em... Electric Magic Co. Vox/Fax: +1 (408) 907 2101 |
From: Michael D. C. <cra...@go...> - 2003-02-09 06:49:05
|
If I make a button with ZUIFactory::Make_ButtonPush, it looks OK under Mac OS 9, but when drawn in the Aqua appearance under OS X, the buttom couple of pixels is always cut off. It looks like some adjustment for the size needs to be done under the case of OS X. I'm happy to try to fix this, but I've never done any Appearance Manager programming. Maybe if someone could give me some tips on what I need to do, I can fix it. Thanks, Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Michael D. C. <cra...@go...> - 2003-02-09 00:15:19
|
I've been trying to put a slider in my window but nothing shows up. Looking into the code, trying to draw it calls through to RenderSlider. This seems to only be defined for the platinum renderer but the function body is empty. Is the slider not yet implemented or am I just missing something? If it's not there yet I can do a scroll bar for now. I'll try to implement a slider and contribute it. I did one on a previous project. I've been such a slacker the last couple of weeks it's taken me several days to figure out where my slider is at. Yer pal, Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Michael D. C. <cra...@go...> - 2003-01-22 03:32:13
|
You all might want to go participate in: Cross-Platform GUI Toolkits (Again)? http://developers.slashdot.org/article.pl?sid=03/01/21/2036250&mode=thread&tid=156 I managed to get in a comment about ZooLib that has gotten moderated up a little bit. But it would help our visibility if more ZooLib people would post there. Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Michael D. C. <cra...@go...> - 2003-01-18 03:35:55
|
Friends, I though the joke in the following Slashdot post was so funny that I just had to share it with you: http://slashdot.org/comments.pl?sid=51103&cid=5105638 Yours, Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Michael D. C. <cra...@go...> - 2003-01-09 03:40:05
|
You can write Linux daemons in ZooLib. What would it take to write a Windows NT service? That's what you use in place of daemons on Windows. They are faceless background tasks that keep running even when you're logged out. I don't know much about NT services, but it seems to me that it should be straightforward to do. Anybody here know much about NT services? An NT service should work unmodified on Windows 2000 and Windows XP as well. Yours, Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Michael D. C. <cra...@go...> - 2003-01-07 13:29:16
|
Friends, My client WiebeTech will be demonstrating their product FireWire Encrypt at the MacWorld Expo starting today. (Booth 1651) FireWire encrypt is a sector-level hard drive encryptor. It is very easy to use, because the encryption algorithm is entirely embedded in a FireWire to IDE bridge. The only host software required is a simple applet for passphrase entry. That applet, FireWire Encrypt Login, is a ZooLib application! WiebeTech is demonstrating FireWire Encrypt working with Mac OS X, but in good part due to ZooLib's cross-platform capabilities, the product is expected to also support Windows, Linux and classic Mac OS when it is released to the public. MacCentral just posted some coverage of it at: http://maccentral.macworld.com/news/0301/07.wiebetech.php Now you know why I was looking into ZooLib's one-way hashing algorithms the other day. The encryption key for the Rijndael algorithm can be a 16, 24 or 32 byte binary value, but nobody's going to remember a 32-byte binary value. What you normally do, and what FireWire Encrypt Login does, is allow the user to enter a textual passphrase of any length, and then hash it into a key of the desired length. I encountered a couple unexpected challenges in writing FireWire Encrypt Login. The latest CodeWarrior I have is CodeWarrior 6, which claims to support OS X but turns out not to work very well at all on OS X. I tried for a while to get ZooLib to build with Project Builder, but I couldn't get ZooLib to actually work with Project Builder (I was trying out the ButtonMessage demo, which is about as simple a ZooLib application as you can get). I do plan to go back and figure out the problem and get ZooLib to support Project Builder, though. I ended up doing most of the UI work on OS 9.2, where CW6 works fine, and then adding in a user space firewire drive that I had been able to write in command-line form in Project Builder. But that presented another challenge - CodeWarrior 6 can only do Code Fragment Manager applications, and the IOKit is only supported when used from Mach-O applications. With Andy's help I found out there is some DTS sample code called "CallMachOFramework", that did most of what I needed. What it allows you to do is manually link to a Mach-O library at runtime. Then my last problem was that my Mach-O calls would only work up to a point, and then consistently crash. I had a hard time figuring it out because the CW6 debugger wouldn't work for me on OS X. It turns out that the problem was that the calling conventions for dereferencing pointers to functions are different between CFM and Mach-O! A Mach-O function pointer points to real code, but a CFM function pointer is a pointer to a small data structure called a transition vector, or TVector. What you do is make an array of two void*'s. Put the Mach-O function pointer into the first one, and set the other to NULL. Cast the address of the first array element to your function pointer type, and call it. Scary, no? It looks like you're jumping into data! But it worked great. James Wiebe was very pleased at the look of FireWire Encrypt. Thanks to all the ZooLib developers for making this possible for me. I'll try to post a screen shot soon. Regards, Mike Crawford Regards, Mike Crawford -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Andrew G. <ag...@em...> - 2003-01-07 01:40:13
|
On 05 Jan 2003 16:07:07 +0100, Conrad Weyns wrote: > >A quick fix is to not make the byte swap function inline, but that is > >obviously less efficient and not what I think is wanted. A Bit more > >assembly magic is required. Excellent. The inline should achieve the same goal, but clearly is very dependent on both compiler version and I expect on optimizations. Anyway, I've merged your patch (with one minor tweak to use swapResult rather than localData[i] at line 5) and will check it in momentarily. A+ -- Andrew Green mailto:ag...@em... Electric Magic Co. Vox/Fax: +1 (408) 907 2101 |
From: Andrew G. <ag...@em...> - 2003-01-07 01:22:59
|
On 02 Jan 2003 02:20:22 -0500, Michael D. Crawford wrote: > In building ZooLib under project builder (with g++) I get a lot of warning > messages about classes that have some virtual functions but don't have virtual > destructors. ZMutexBase is one, I think there are others. > > That is probably not what we want. > > If you have a non-virtual destructor and you delete an object whose real type > is a derived type, by deleting a pointer of the base type, you will call the > base class' destructor but not the derived class' destructor. > > That would be OK if you never had any derived classes. It is common for STL > templates to not have virtual destructors. They are not meant to be used as > base classes. > > If you have some virtual member functions in a class, that suggests that this > is meant to be a base class. If you have a pointer of base type that really > points to an object of derived type, and call one of the virtual functions > through the pointer, you will get a call to the derived class' version of the > function, if there is one. > > Generally you either want no virtual functions at all (in which case you > shouldn't inherit from the class) or if you do intend this to be a base class, > the destructor should be virtual. In general this is correct. However in this case ZMutexBase is intended not as a base class for implementation-inheritance, but as an interface definition. The indication that this is the case is that the destructor and constructor are protected, and copy-constructor and assignment are private. You cannot use any aspect of a ZMutexBase *other* than it's virtual methods -- you can't create, assign, copy from or delete with a ZMutexBase reference or pointer. A+ -- Andrew Green mailto:ag...@em... Electric Magic Co. Vox/Fax: +1 (408) 907 2101 |
From: Michael D. C. <cra...@go...> - 2003-01-06 05:59:46
|
I'm planning on redesigning to zoolib website at sourceforge. My wife, who has a web design business, has offerred to help. As part of that I would like to post some screenshots of ZooLib applications. I'm asking you to email me some screenshots. You can send them in any graphic format that's convenient to you, I can convert them to whatever format I use for the web page. If your application has a web page, send the URL and I will post a link. I just wrote a small but useful commercial zoolib application. I'll post a screenshot on the website after Tuesday, when my client will announce the product at MacWorld. I'll make screenshots of the existing demo programs myself. It would be especially helpful if you could make screenshots of your product on each of the platforms it supports, as that would emphasize ZooLib's crossplatformness. But if it's not convenient or you only support one platform, that's OK. Send the screenshots to cra...@go... Thanks! Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Conrad W. <we...@on...> - 2003-01-05 15:07:08
|
>A quick fix is to not make the byte swap function inline, but that is >obviously less efficient and not what I think is wanted. A Bit more >assembly magic is required. Here is an option that seems to produce a lot more efficient code. However, I am an old 68k programmer, my ppc knowlegde is not very good so mr Andy Green should probably verify this! 1. New macro for MD5STEP1 when BigEndian #if ZCONFIG(Endian, Big) # define MD5STEP1(f, w, x, y, z, i, c, s) \ inValueAddress = iData + i; \ asm { lwbrx swapResult, r0, inValueAddress }; \ localData[i] = swapResult; \ w += f(x, y, z) + c + localData[i]; \ w = w<<s | w>>(32-s); \ w += x Notice the byte swap is now in the macro and expecting 2 predifined registers global to the "calling" function: inValueAddress and swapResult. 2. Add two new locals to sMD5_Transform static void sMD5_Transform(uint32 ioState[4], const uint32 iData[16]) { uint32 a = ioState[0]; uint32 b = ioState[1]; uint32 c = ioState[2]; uint32 d = ioState[3]; register const void* inValueAddress; register int32 swapResult; .......... Here is a dump of the code produced by the new macro: MD5STEP1(F1, a, b, c, d, 0, 0xd76aa478, 7); 0000001C: 7F1EC378 mr r30,r24 00000020: 7FE0F42C lwbrx r31,r0,r30 00000024: 93E1FFA0 stw r31,-96(SP) 00000028: 8081FFA0 lwz r4,-96(SP) 0000002C: 7F80EA78 xor r0,r28,r29 00000030: 7F600038 and r0,r27,r0 00000034: 7FA30278 xor r3,r29,r0 00000038: 3C03D76B subis r0,r3,10389 0000003C: 7C002214 add r0,r0,r4 00000040: 7F40D214 add r26,r0,r26 00000044: 3B5AA478 subi r26,r26,23432 00000048: 57433830 slwi r3,r26,7 0000004C: 57403E7E srwi r0,r26,25 00000050: 7C7A0378 or r26,r3,r0 00000054: 7F5ADA14 add r26,r26,r27 MD5STEP1(F1, d, a, b, c, 1, 0xe8c7b756, 12); 00000058: 3BD80004 addi r30,r24,4 0000005C: 7FE0F42C lwbrx r31,r0,r30 00000060: 93E1FFA4 stw r31,-92(SP) 00000064: 8081FFA4 lwz r4,-92(SP) And here is a dump of the code produced by the old macro: MD5STEP1(F1, a, b, c, d, 0, 0xd76aa478, 7); 0000003C: 8201001C lwz r16,28(SP) 00000040: 7E20842C lwbrx r17,r0,r16 00000044: 9221FF60 stw r17,-160(SP) 00000048: 80C1FF50 lwz r6,-176(SP) 0000004C: 80A1FF5C lwz r5,-164(SP) 00000050: 8081FF54 lwz r4,-172(SP) 00000054: 8061FF58 lwz r3,-168(SP) 00000058: 8001FF5C lwz r0,-164(SP) 0000005C: 7C600278 xor r0,r3,r0 00000060: 7C800038 and r0,r4,r0 00000064: 7CA30278 xor r3,r5,r0 00000068: 3C63D76B subis r3,r3,10389 0000006C: 8001FF60 lwz r0,-160(SP) 00000070: 9001FF80 stw r0,-128(SP) 00000074: 7C030214 add r0,r3,r0 00000078: 7C603214 add r3,r0,r6 0000007C: 3803A478 subi r0,r3,23432 00000080: 9001FF50 stw r0,-176(SP) 00000084: 8001FF50 lwz r0,-176(SP) 00000088: 54033830 slwi r3,r0,7 0000008C: 8001FF50 lwz r0,-176(SP) 00000090: 54003E7E srwi r0,r0,25 00000094: 7C600378 or r0,r3,r0 00000098: 9001FF50 stw r0,-176(SP) 0000009C: 8061FF50 lwz r3,-176(SP) 000000A0: 8001FF54 lwz r0,-172(SP) 000000A4: 7C030214 add r0,r3,r0 000000A8: 9001FF50 stw r0,-176(SP) MD5STEP1(F1, d, a, b, c, 1, 0xe8c7b756, 12); 000000AC: 8061001C lwz r3,28(SP) 000000B0: 3A430004 addi r18,r3,4 000000B4: 7E60942C lwbrx r19,r0,r18 000000B8: 9261FF64 stw r19,-156(SP) 000000BC: 80C1FF5C lwz r6,-164(SP) 000000C0: 80A1FF58 lwz r5,-168(SP) 000000C4: 8081FF50 lwz r4,-176(SP) 000000C8: 8061FF54 lwz r3,-172(SP) 000000CC: 8001FF58 lwz r0,-168(SP) /Conrad > >Cheers, >Conrad Weyns. > > > >> >>When I try to compile it while running on OS 9.2, CodeWarrior complains >>that it >>doesn't have enough registers to compile. If I try to compile it while >>running >>OS X, CodeWarrior unexpectedly quits. >> >>I need a hash for something that I'm doing, but happily there is also >>ZStream_SHA1.cpp, which should work fine for me. >> >>Mike >>-- >>Michael D. Crawford >>GoingWare Inc. - Expert Software Development and Consulting >>http://www.goingware.com/ >>cra...@go... >> >> Tilting at Windmills for a Better Tomorrow. >> >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Welcome to geek heaven. >>http://thinkgeek.com/sf >>_______________________________________________ >>ZooLib-dev mailing list >>Zoo...@li... >>https://lists.sourceforge.net/lists/listinfo/zoolib-dev >> >> > > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >ZooLib-dev mailing list >Zoo...@li... >https://lists.sourceforge.net/lists/listinfo/zoolib-dev > > |
From: Conrad W. <we...@on...> - 2003-01-05 12:53:59
|
>CodeWarrior 6 can't compile ZStream_MD5.cpp. I don't think this is an >error in >the source code. I think that the code is correct but complex enough that it >gives the compiler fits. I updated to the latest cvs code and I now also get this problem under both CW Pro 7 and Pro 8.3 as opposed to an older version I had that did not cause compiler problems. New version: ZStream_MD5.cpp,v 1.4 2002/08/22 Old version: ZStream_MD5.cpp,v 1.2 2002/03/15 After studying preprocesser and disassembly outputs, the answer is simple: The MD5STEP1 macro changed and among other it now contains an inline assembly function: inline int32 ZByteSwap_Read32(register const void* inValueAddress) { register int32 result; asm { lwbrx result, r0, inValueAddress } return result; } Note that for the lwbrx instruction, result and inValueAddress *must* be registers. Because this is inlined in the MD5STEP1 macro, for every substitution of ZByteSwap_Read32 *two* registers will be required. After 8 consecutive uses of the macro, the ppc chip runs out of registers.... This is because for *every* inlined ZByteSwap_Read32, both inValueAddress and result are essensially unique labels. A quick fix is to not make the byte swap function inline, but that is obviously less efficient and not what I think is wanted. A Bit more assembly magic is required. Cheers, Conrad Weyns. > >When I try to compile it while running on OS 9.2, CodeWarrior complains >that it >doesn't have enough registers to compile. If I try to compile it while >running >OS X, CodeWarrior unexpectedly quits. > >I need a hash for something that I'm doing, but happily there is also >ZStream_SHA1.cpp, which should work fine for me. > >Mike >-- >Michael D. Crawford >GoingWare Inc. - Expert Software Development and Consulting >http://www.goingware.com/ >cra...@go... > > Tilting at Windmills for a Better Tomorrow. > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >ZooLib-dev mailing list >Zoo...@li... >https://lists.sourceforge.net/lists/listinfo/zoolib-dev > > |
From: Michael D. C. <cra...@go...> - 2003-01-05 02:29:06
|
CodeWarrior 6 can't compile ZStream_MD5.cpp. I don't think this is an error in the source code. I think that the code is correct but complex enough that it gives the compiler fits. When I try to compile it while running on OS 9.2, CodeWarrior complains that it doesn't have enough registers to compile. If I try to compile it while running OS X, CodeWarrior unexpectedly quits. I need a hash for something that I'm doing, but happily there is also ZStream_SHA1.cpp, which should work fine for me. Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Michael D. C. <cra...@go...> - 2003-01-02 12:38:52
|
Well, after taking all night coming to grips with Project Builder (I hadn't used it that much before), I've got ButtonMessage to compile, link and run. However, it doesn't show a window. But I haven't checked what state the sources in CVS are actually in when built in codewarrior - i've seen this happen before and it was some minor bug. I can compile programs under OS X in CodeWarrior 6, I just can't debug them. Only a few minor changes to the sources were needed for Project Builder compatibility. There are a couple places where I'm not sure what I need to do. There doesn't seem to be a wchar_t.h header anywhere that I could find. That messes up ZUnicode.cpp. Maybe I'm missing something. The biggest trouble I had was getting Project Builder to find its header files. That seems to have been fixed by adding Carbon.framework to the project. It didn't work to add CoreServices.framework, which was where MacTypes.h lived. I probably won't check in the project I've got for a few days, it really needs cleaning up. I'm trying to get a demo ready for MacWorld. After I make my delivery I'll do the work for Project Builder support properly and check it in. Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Michael D. C. <cra...@go...> - 2003-01-02 07:17:28
|
In building ZooLib under project builder (with g++) I get a lot of warning messages about classes that have some virtual functions but don't have virtual destructors. ZMutexBase is one, I think there are others. That is probably not what we want. If you have a non-virtual destructor and you delete an object whose real type is a derived type, by deleting a pointer of the base type, you will call the base class' destructor but not the derived class' destructor. That would be OK if you never had any derived classes. It is common for STL templates to not have virtual destructors. They are not meant to be used as base classes. If you have some virtual member functions in a class, that suggests that this is meant to be a base class. If you have a pointer of base type that really points to an object of derived type, and call one of the virtual functions through the pointer, you will get a call to the derived class' version of the function, if there is one. Generally you either want no virtual functions at all (in which case you shouldn't inherit from the class) or if you do intend this to be a base class, the destructor should be virtual. Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Michael D. C. <cra...@go...> - 2003-01-02 00:44:03
|
Can ZooLib be built with ProjectBuilder under OS X? Most of the code should have no problem with g++ because it's also used under Linux, but the Carbon platform-specific part might not yet have been built with g++. The latest CodeWarrior that I have is CodeWarrior 6, and I'm not having much luck with debugging under OS X with CW6. Some searching at http://groups.google.com/ in the comp.sys.mac.programmer.codewarrior reveals that a lot of people have had trouble with it. I expect the problems have been fixed in a later CodeWarrior release, but I don't have time to purchase it before I need to make a delivery. I guess I should have checked before now. While I'm waiting for an answer, I'll see what I can do with ProjectBuilder. Thanks, Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: Michael D. C. <cra...@go...> - 2002-12-29 04:10:44
|
I should have said, if you haven't read what I've written so far, the work in progress is at: http://www.goingware.com/zoolib/cookbook/ The DocBook XML markup source is checked into ZooLib's CVS at sourceforge. I value any comments anyone may have on what I've written so far. One thing I know it could use is some illustrations. Mike -- Michael D. Crawford GoingWare Inc. - Expert Software Development and Consulting http://www.goingware.com/ cra...@go... Tilting at Windmills for a Better Tomorrow. |
From: David L R. <zo...@dr...> - 2002-12-29 04:05:36
|
A good cookbook and nice example code, I think will kickstart Zoolib. Good examples will get the intermediate C/C++ programmers in who are looking for a good cross platform framework to play with. Once they know the code then they are more likely to stick with it as they learn and hopefully help build. I look forward to reading your work! At 6:52 PM -0500 28/12/2002, Michael D. Crawford wrote: >I have decided that my New Years resolution is that I will finish >writing The ZooLib Cookbook. > >I got a good start on it, but things got kind of crazy in my >consulting business. But despite being busy, I really think I >should be able to find time to write regularly. > >If I can write only a chapter a month, I should have a respectable >book by the end of the year. > >I emailed a technical book publisher a while back and asked if >they'd be interested in publishing the Cookbook in dead tree format. >They were interested, but said that they didn't think ZooLib had a >big enough user base that they could expect to sell out a printing >(they said they'd need to sell 10,000 books). > >But I think if I can get the Cookbook complete, it will go a long >ways towards popularizing ZooLib, as the usual resistance I meet >from people who I propose it to is that it is poorly documented. >For that I must accept full responsibility, and I am determined to >change that. > >Yours, > >Mike >-- >Michael D. Crawford >GoingWare Inc. - Expert Software Development and Consulting >http://www.goingware.com/ >cra...@go... > > Tilting at Windmills for a Better Tomorrow. > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >ZooLib-dev mailing list >Zoo...@li... >https://lists.sourceforge.net/lists/listinfo/zoolib-dev -- David L Robinson - me...@dr... - ICQ# 8955819 YahooID: drobinsoncomau - MSN: dro...@ho... - AIM: drobinsoncomau Phone: 1800 222 589 int +61 2 66287472 Fax: 1800 222 FAX (1800 222 329) int +61 2 66283492 Web: http://drobinson.com.au Mail: P.O.Box 550, Lismore, NSW 2480 Real Geeks never die. Their E-mail addresses just bounce. -- me...@dr... "I don't think so," said Rene Descartes. Just then, he vanished. -- Unknown Those who don't write down thoughts and ideas immediately are doomed to rethink them. -- me...@dr... To force your beliefs on others, thats wrong. To force your culture on others, thats wrong. One should always walk the talk and if others follow then be proud they respect you or your beliefs and join with free will. -- David Robinson me...@dr... If we found intelligent life on another planet, would we eat it? or would it become a Japanese delicacy in the name of science? -- David Robinson me...@dr... Sometimes its only through others that we can see own full potential. -- me...@dr... Code your kids right, Use Linux. -- Warren and me...@dr... Become a UNIX guru, you will. But first you must walk down vi path before attacking great emacs. -- yo...@dr... New Yoda UNIX Shell: Yoda: --force luke.gz rm Yoda: vi important.doc vi: File you want, hrmm gone. Restore, you must. Yoda: mkfs.vfat /dev/hda1 mkfs: format the drive, you will. hrmm turning to dark side, I see. |