OLD | NEW |
1 //------------------------------------------------------------------------------
--- | 1 //------------------------------------------------------------------------------
--- |
2 // | 2 // |
3 // Little Color Management System | 3 // Little Color Management System |
4 // Copyright (c) 1998-2010 Marti Maria Saguer | 4 // Copyright (c) 1998-2010 Marti Maria Saguer |
5 // | 5 // |
6 // Permission is hereby granted, free of charge, to any person obtaining | 6 // Permission is hereby granted, free of charge, to any person obtaining |
7 // a copy of this software and associated documentation files (the "Software"), | 7 // a copy of this software and associated documentation files (the "Software"), |
8 // to deal in the Software without restriction, including without limitation | 8 // to deal in the Software without restriction, including without limitation |
9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, | 9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, |
10 // and/or sell copies of the Software, and to permit persons to whom the Softwar
e | 10 // and/or sell copies of the Software, and to permit persons to whom the Softwar
e |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 if (io -> Read(io, &tmp, sizeof(cmsFloat32Number), 1) != 1) | 175 if (io -> Read(io, &tmp, sizeof(cmsFloat32Number), 1) != 1) |
176 return FALSE; | 176 return FALSE; |
177 | 177 |
178 if (n != NULL) { | 178 if (n != NULL) { |
179 | 179 |
180 tmp = _cmsAdjustEndianess32(tmp); | 180 tmp = _cmsAdjustEndianess32(tmp); |
181 *n = *(cmsFloat32Number*) &tmp; | 181 *n = *(cmsFloat32Number*) &tmp; |
182 if (isnan(*n)) | 182 if (isnan(*n)) |
183 return FALSE; | 183 return FALSE; |
184 } | 184 } |
185 return TRUE; | 185 |
| 186 // fpclassify() required by C99 |
| 187 return (fpclassify(*n) == FP_ZERO) || (fpclassify(*n) == FP_NORMAL); |
186 } | 188 } |
187 | 189 |
188 | 190 |
189 cmsBool CMSEXPORT _cmsReadUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n) | 191 cmsBool CMSEXPORT _cmsReadUInt64Number(cmsIOHANDLER* io, cmsUInt64Number* n) |
190 { | 192 { |
191 cmsUInt64Number tmp; | 193 cmsUInt64Number tmp; |
192 | 194 |
193 _cmsAssert(io != NULL); | 195 _cmsAssert(io != NULL); |
194 | 196 |
195 if (io -> Read(io, &tmp, sizeof(cmsUInt64Number), 1) != 1) | 197 if (io -> Read(io, &tmp, sizeof(cmsUInt64Number), 1) != 1) |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
948 // free the memory block itself | 950 // free the memory block itself |
949 _cmsFree(&fakeContext, ctx); | 951 _cmsFree(&fakeContext, ctx); |
950 } | 952 } |
951 } | 953 } |
952 | 954 |
953 // Returns the user data associated to the given ContextID, or NULL if no user d
ata was attached on context creation | 955 // Returns the user data associated to the given ContextID, or NULL if no user d
ata was attached on context creation |
954 void* CMSEXPORT cmsGetContextUserData(cmsContext ContextID) | 956 void* CMSEXPORT cmsGetContextUserData(cmsContext ContextID) |
955 { | 957 { |
956 return _cmsContextGetClientChunk(ContextID, UserPtr); | 958 return _cmsContextGetClientChunk(ContextID, UserPtr); |
957 } | 959 } |
OLD | NEW |