Date: Tue, 30 Jan 2001 05:08:27 -0500 From: AAganichev AT netscape DOT net (Alexander Aganichev) To: djgpp-workers AT delorie DOT com Subject: Re: locale support: 2nd approach Mime-Version: 1.0 Message-ID: <1469886D.293AE18A.09ACFA57@netscape.net> References: <75955792 DOT 7119524B DOT 09ACFA57 AT netscape DOT net> <200101291742 DOT MAA10181 AT envy DOT delorie DOT com> X-Mailer: Franklin Webmailer 1.0 Content-Type: text/plain; charset="ISO-8859-1" Reply-To: djgpp-workers AT delorie DOT com djgpp-workers AT delorie DOT com wrote: > Couple of little nits, haven't read it closely yet. > > #include > Use for libc functions. > > static char lcn_collate[256] š= "C"; > > static char lcn_ctype[256] š š= "C"; > > static char lcn_monetary[256] = "C"; > > static char lcn_numeric[256] š= "C"; > > static char lcn_time[256] š š = "C"; These arrays should be big enough to store any of supported locale. I'll make define for size (LOCALE_MAX_STRING_SIZE) and put loc2id array strings into arrays to determine overflow at time of compilation in case someone add very long locale. > > š if (category == LC_ALL) { > Please put open braces under the if, not on the same line. Is it Ok to apply `indent -npcs' to the sources? Any other switches required/recommended? > > š š š š š tolower(i) = i; > > š š š š š toupper(i) = i; > This isn't portable, or even a good idea. Fixed. > > š static char rv[256]; > Another big buffer to bloat programs with? Actually it should be 5*LOCALE_MAX_STRING_SIZE, I'll fix it. And thanks to pointing on these, I've found small bug there. Will fix, retest and resend. -- Alexander Aganichev Hypercom Europe Limited, Inc. Software Engineer __________________________________________________________________ Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/