MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / CanMakeLong

Function CanMakeLong

include/bmpread/bmpread.c:103–111  ·  view source on GitHub ↗

Returns nonzero if the uint32_t can be converted to a long without losing * data, or 0 if the conversion would lose data. */

Source from the content-addressed store, hash-verified

101 * data, or 0 if the conversion would lose data.
102 */
103static int CanMakeLong(uint32_t x)
104{
105#if UINT32_MAX > LONG_MAX
106 if(x > LONG_MAX) return 0;
107#endif
108
109 (void)x; /* Sometimes unused. */
110 return 1;
111}
112
113/* Returns nonzero if the int32_t can be negated properly. INT32_MIN doesn't
114 * work because its positive value isn't representable inside an int32_t (given

Callers 2

ValidateAndReadPaletteFunction · 0.85
DecodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected