projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mesa: refactor: move glReadPixels code into new readpix.c file
[mesa.git]
/
src
/
mesa
/
main
/
imports.c
diff --git
a/src/mesa/main/imports.c
b/src/mesa/main/imports.c
index 8a5dfdb4b80e3ccffd9ad89f49e69aec0a61690f..d798f80e25316612ba3d0b6616c8113ed1079896 100644
(file)
--- a/
src/mesa/main/imports.c
+++ b/
src/mesa/main/imports.c
@@
-542,26
+542,24
@@
int
_mesa_ffs(int i)
{
#if (defined(_WIN32) && !defined(__MINGW32__) ) || defined(__IBMC__) || defined(__IBMCPP__)
_mesa_ffs(int i)
{
#if (defined(_WIN32) && !defined(__MINGW32__) ) || defined(__IBMC__) || defined(__IBMCPP__)
- register int bit = 0;
- if (i != 0) {
- if ((i & 0xffff) == 0) {
- bit += 16;
- i >>= 16;
- }
- if ((i & 0xff) == 0) {
- bit += 8;
- i >>= 8;
- }
- if ((i & 0xf) == 0) {
- bit += 4;
- i >>= 4;
- }
- while ((i & 1) == 0) {
- bit++;
- i >>= 1;
- }
+ register int bit = 1;
+ if ((i & 0xffff) == 0) {
+ bit += 16;
+ i >>= 16;
+ }
+ if ((i & 0xff) == 0) {
+ bit += 8;
+ i >>= 8;
+ }
+ if ((i & 0xf) == 0) {
+ bit += 4;
+ i >>= 4;
}
}
- return bit;
+ if ((i & 0x3) == 0) {
+ bit += 2;
+ i >>= 2;
+ }
+ return (i) ? (bit + ((i + 1) & 0x01)) : 0;
#else
return ffs(i);
#endif
#else
return ffs(i);
#endif
@@
-575,7
+573,11
@@
_mesa_ffs(int i)
* if no bits set.
*/
int
* if no bits set.
*/
int
+#ifdef __MINGW32__
+_mesa_ffsll(long val)
+#else
_mesa_ffsll(long long val)
_mesa_ffsll(long long val)
+#endif
{
#ifdef ffsll
return ffsll(val);
{
#ifdef ffsll
return ffsll(val);
@@
-898,12
+900,10
@@
_mesa_sprintf( char *str, const char *fmt, ... )
void
_mesa_printf( const char *fmtString, ... )
{
void
_mesa_printf( const char *fmtString, ... )
{
- char s[MAXSTRING];
va_list args;
va_start( args, fmtString );
va_list args;
va_start( args, fmtString );
- v
snprintf(s, MAXSTRING
, fmtString, args);
+ v
fprintf(stderr
, fmtString, args);
va_end( args );
va_end( args );
- fprintf(stderr,"%s", s);
}
/** Wrapper around vsprintf() */
}
/** Wrapper around vsprintf() */