bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPathUtilities Patch - 4 - NSPathUtilities.h


From: Kazunobu Kuriyama
Subject: Re: NSPathUtilities Patch - 4 - NSPathUtilities.h
Date: Tue, 20 Apr 2004 18:16:41 +0900
User-agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1

Sheldon Gill wrote:

Some changes need to be made to the NSPathUtilities header:

Modified enumerations to be more in line with MacOS X. Includes provision for
adding more GS directory keys without future conflict. This change breaks
binary backwards compatibility so you will need to re-compile libraries and applications which use these functions.

Because every programmer is supposed to write her/his code in such a way
that it doesn't depend on enums' actual values, I don't think all of the
proposed changes are necessary at the cost of backwards compatibility. In fact, some of enum values specified by Apple merely appear conventional and hence aren't for bitwise operations. So I think assigning specific values to enums is superfluous (but enums for bitwise operations). Adding new enums to
the old ones is enough, isn't it?  (Or Apple recommends a bad C programming
style?  Perhaps, not.  I guess these enums were once constant macros; when
the enums took over old #define's, particular values were assigned to the former
for backwards compatibility.  Have you ever experienced anything like that,
haven't you?  So I don't think we need to take the assignments seriously.)

If assigning particular values to them is so significant, why don't you set
NSAllDomainsMask to 0x0ffff (cf. the code blow, excerpted from your patch),
the value of which is specified in the Apple's doc.

-typedef unsigned int NSSearchPathDomainMask;
-#define NSUserDomainMask 0x00000001
-#define NSLocalDomainMask 0x00000002
-#define NSNetworkDomainMask 0x00000004
-#define NSSystemDomainMask 0x00000008
-#define NSAllDomainsMask 0xffffffff
+typedef enum
+{
+ NSUserDomainMask = 1,
+ NSLocalDomainMask = 2,
+ NSNetworkDomainMask = 4,
+ NSSystemDomainMask = 8,
+ NSAllDomainsMask = 0xffffffff,
+} NSSearchPathDomainMask;

Said that, I'm interested in your project, though.  I'm skeptic with
GNUstep.sh, too.

Cheers,
- Kazunobu Kuriyama





reply via email to

[Prev in Thread] Current Thread [Next in Thread]