From: Jim M. <jmi...@ya...> - 2011-03-21 01:03:26
|
I don't know who to go to to make this change request to the c library standard (ANSI C Library?). it would not break any existing code, but it would make the function EVER more useful! in ctype.h, these macros should be redefined. http://msdn.microsoft.com/en-us/library/45119yx3%28VS.80%29.aspx http://msdn.microsoft.com/en-us/library/8h19t214%28VS.71%29.aspx #define toupper(ch) ((ch>='a'&&ch<='z')?ch-('a'-'A'):ch) #define tolower(ch) ((ch>='A'&&ch<='Z')?ch+('a'-'A'):ch) simple? the old definition simply subtracts and thus requires an if statement to properly work - so why did they bother to code this this way in the first place if they didn't want to plan on it being useful: if I am correct, the microsoft compiler does the same thing, and it was in the msdn documentation - until someone took it out. this is for the ascii definition version. and I'm sure you can simply use a regular function for the rest (and I thought about inline as a possibility for the more complex stuff that needs real if statements). I am having to code my own versions of these. ------------- Jim Michaels jmi...@ya... JimM@JimsComputerRepairandWebDesign.com http://JimsComputerRepairandWebDesign.com http://JesusnJim.com (my personal site, has software) http://DoLifeComputers.JesusnJim.com (group which I lead) --- Computer memory/disk size measurements: [KB KiB] [MB MiB] [GB GiB] [TB TiB] [10^3B=1,000B=1KB][2^10B=1,024B=1KiB] [10^6B=1,000,000B=1MB][2^20B=1,048,576B=1MiB] [10^9B=1,000,000,000B=1GB][2^30B=1,073,741,824B=1GiB] [10^12B=1,000,000,000,000B=1TB][2^40B=1,099,511,627,776B=1TiB] Note: disk size is measured in MB, GB, or TB, not in MiB, GiB, or TiB. computer memory (RAM) is measured in MiB and GiB. |
From: NightStrike <nig...@gm...> - 2011-03-21 17:23:03
|
On Sun, Mar 20, 2011 at 9:03 PM, Jim Michaels <jmi...@ya...> wrote: > I don't know who to go to to make this change request to the c library > standard (ANSI C Library?). > it would not break any existing code, but it would make the function EVER > more useful! Microsoft maintains the library. We just consume it. You'd have to bring this up with MS. > in ctype.h, these macros should be redefined. > http://msdn.microsoft.com/en-us/library/45119yx3%28VS.80%29.aspx > http://msdn.microsoft.com/en-us/library/8h19t214%28VS.71%29.aspx > > #define toupper(ch) ((ch>='a'&&ch<='z')?ch-('a'-'A'):ch) > #define tolower(ch) ((ch>='A'&&ch<='Z')?ch+('a'-'A'):ch) > > simple? > > the old definition simply subtracts and thus requires an if statement to > properly work - so why did they bother to code this this way in the first > place if they didn't want to plan on it being useful: > if I am correct, the microsoft compiler does the same thing, and it was in > the msdn documentation - until someone took it out. > > this is for the ascii definition version. and I'm sure you can simply use a > regular function for the rest (and I thought about inline as a possibility > for the more complex stuff that needs real if statements). > > I am having to code my own versions of these. > > ------------- > Jim Michaels > jmi...@ya... > JimM@JimsComputerRepairandWebDesign.com > http://JimsComputerRepairandWebDesign.com > http://JesusnJim.com (my personal site, has software) > http://DoLifeComputers.JesusnJim.com (group which I lead) > --- > Computer memory/disk size measurements: > [KB KiB] [MB MiB] [GB GiB] [TB TiB] > [10^3B=1,000B=1KB][2^10B=1,024B=1KiB] > [10^6B=1,000,000B=1MB][2^20B=1,048,576B=1MiB] > [10^9B=1,000,000,000B=1GB][2^30B=1,073,741,824B=1GiB] > [10^12B=1,000,000,000,000B=1TB][2^40B=1,099,511,627,776B=1TiB] > Note: disk size is measured in MB, GB, or TB, not in MiB, GiB, or TiB. > computer memory (RAM) is measured in MiB and GiB. > > > > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > Mingw-w64-public mailing list > Min...@li... > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public > > |
From: Prof B. R. <ri...@st...> - 2011-03-22 09:08:00
|
On Mon, 21 Mar 2011, NightStrike wrote: > On Sun, Mar 20, 2011 at 9:03 PM, Jim Michaels <jmi...@ya...> wrote: >> I don't know who to go to to make this change request to the c library >> standard (ANSI C Library?). >> it would not break any existing code, but it would make the function EVER >> more useful! > > Microsoft maintains the library. We just consume it. You'd have to > bring this up with MS. And there is a C standard, and according to it, those macros are plain wrong. toupper() has to depend on the locale: see e.g. http://pubs.opengroup.org/onlinepubs/009695399/functions/tolower.html > > >> in ctype.h, these macros should be redefined. >> http://msdn.microsoft.com/en-us/library/45119yx3%28VS.80%29.aspx >> http://msdn.microsoft.com/en-us/library/8h19t214%28VS.71%29.aspx >> >> #define toupper(ch) ((ch>='a'&&ch<='z')?ch-('a'-'A'):ch) >> #define tolower(ch) ((ch>='A'&&ch<='Z')?ch+('a'-'A'):ch) >> >> simple? >> >> the old definition simply subtracts and thus requires an if statement to >> properly work - so why did they bother to code this this way in the first >> place if they didn't want to plan on it being useful: >> if I am correct, the microsoft compiler does the same thing, and it was in >> the msdn documentation - until someone took it out. >> >> this is for the ascii definition version. and I'm sure you can simply use a >> regular function for the rest (and I thought about inline as a possibility >> for the more complex stuff that needs real if statements). >> >> I am having to code my own versions of these. >> >> ------------- >> Jim Michaels >> jmi...@ya... >> JimM@JimsComputerRepairandWebDesign.com >> http://JimsComputerRepairandWebDesign.com >> http://JesusnJim.com (my personal site, has software) >> http://DoLifeComputers.JesusnJim.com (group which I lead) >> --- >> Computer memory/disk size measurements: >> [KB KiB] [MB MiB] [GB GiB] [TB TiB] >> [10^3B=1,000B=1KB][2^10B=1,024B=1KiB] >> [10^6B=1,000,000B=1MB][2^20B=1,048,576B=1MiB] >> [10^9B=1,000,000,000B=1GB][2^30B=1,073,741,824B=1GiB] >> [10^12B=1,000,000,000,000B=1TB][2^40B=1,099,511,627,776B=1TiB] >> Note: disk size is measured in MB, GB, or TB, not in MiB, GiB, or TiB. >> computer memory (RAM) is measured in MiB and GiB. >> >> >> >> >> ------------------------------------------------------------------------------ >> Colocation vs. Managed Hosting >> A question and answer guide to determining the best fit >> for your organization - today and in the future. >> http://p.sf.net/sfu/internap-sfd2d >> _______________________________________________ >> Mingw-w64-public mailing list >> Min...@li... >> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public >> >> > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > Mingw-w64-public mailing list > Min...@li... > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public > -- Brian D. Ripley, ri...@st... Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 |
From: Vincent T. <vin...@gm...> - 2011-03-22 18:57:34
|
On Tue, Mar 22, 2011 at 9:52 AM, Prof Brian Ripley <ri...@st...>wrote: > On Mon, 21 Mar 2011, NightStrike wrote: > > On Sun, Mar 20, 2011 at 9:03 PM, Jim Michaels <jmi...@ya...> wrote: >> >>> I don't know who to go to to make this change request to the c library >>> standard (ANSI C Library?). >>> it would not break any existing code, but it would make the function EVER >>> more useful! >>> >> >> Microsoft maintains the library. We just consume it. You'd have to >> bring this up with MS. >> > > And there is a C standard, and according to it, those macros are plain > wrong. toupper() has to depend on the locale: see e.g. > http://pubs.opengroup.org/onlinepubs/009695399/functions/tolower.html > MinGW uses the C runtime library of Microsoft (msvcr*.dll). the definition of those functions is there. MinGW(-w64) just declare them. There is nothing the MinGW(-w64) devs can do. Vincent Torri |
From: NightStrike <nig...@gm...> - 2011-03-23 12:28:34
|
On Tue, Mar 22, 2011 at 2:57 PM, Vincent Torri <vin...@gm...> wrote: > > > On Tue, Mar 22, 2011 at 9:52 AM, Prof Brian Ripley <ri...@st...> > wrote: >> >> On Mon, 21 Mar 2011, NightStrike wrote: >> >>> On Sun, Mar 20, 2011 at 9:03 PM, Jim Michaels <jmi...@ya...> wrote: >>>> >>>> I don't know who to go to to make this change request to the c library >>>> standard (ANSI C Library?). >>>> it would not break any existing code, but it would make the function >>>> EVER >>>> more useful! >>> >>> Microsoft maintains the library. We just consume it. You'd have to >>> bring this up with MS. >> >> And there is a C standard, and according to it, those macros are plain >> wrong. toupper() has to depend on the locale: see e.g. >> http://pubs.opengroup.org/onlinepubs/009695399/functions/tolower.html > > MinGW uses the C runtime library of Microsoft (msvcr*.dll). the definition > of those functions is there. MinGW(-w64) just declare them. There is nothing > the MinGW(-w64) devs can do. I suppose in some cases, we do make exception and provide improved variants of standard C functions in libmingwex. But this is an exception, and not the rule. |
From: Kai T. <kti...@go...> - 2011-03-23 12:31:58
|
2011/3/23 NightStrike <nig...@gm...>: > On Tue, Mar 22, 2011 at 2:57 PM, Vincent Torri <vin...@gm...> wrote: >> >> >> On Tue, Mar 22, 2011 at 9:52 AM, Prof Brian Ripley <ri...@st...> >> wrote: >>> >>> On Mon, 21 Mar 2011, NightStrike wrote: >>> >>>> On Sun, Mar 20, 2011 at 9:03 PM, Jim Michaels <jmi...@ya...> wrote: >>>>> >>>>> I don't know who to go to to make this change request to the c library >>>>> standard (ANSI C Library?). >>>>> it would not break any existing code, but it would make the function >>>>> EVER >>>>> more useful! >>>> >>>> Microsoft maintains the library. We just consume it. You'd have to >>>> bring this up with MS. >>> >>> And there is a C standard, and according to it, those macros are plain >>> wrong. toupper() has to depend on the locale: see e.g. >>> http://pubs.opengroup.org/onlinepubs/009695399/functions/tolower.html >> >> MinGW uses the C runtime library of Microsoft (msvcr*.dll). the definition >> of those functions is there. MinGW(-w64) just declare them. There is nothing >> the MinGW(-w64) devs can do. > > I suppose in some cases, we do make exception and provide improved > variants of standard C functions in libmingwex. But this is an > exception, and not the rule. Well, we make exceptions about POSIX-standard extensions in some cases. But here, even if we could, I wouldn't do anything as we have to satisfy standard. But nevetheless you can do such things in your own application, if you are sure you will never hit for it locale problematic. Regards, Kai |