mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
- ditch warnings
This commit is contained in:
parent
e538c3ea1f
commit
2563c13553
@ -359,14 +359,14 @@ PHP_HASH_API void PHP_RIPEMD128Final(unsigned char digest[16], PHP_RIPEMD128_CTX
|
||||
unsigned int index, padLen;
|
||||
|
||||
/* Save number of bits */
|
||||
bits[0] = context->count[0] & 0xFF;
|
||||
bits[1] = (context->count[0] >> 8) & 0xFF;
|
||||
bits[2] = (context->count[0] >> 16) & 0xFF;
|
||||
bits[3] = (context->count[0] >> 24) & 0xFF;
|
||||
bits[4] = context->count[1] & 0xFF;
|
||||
bits[5] = (context->count[1] >> 8) & 0xFF;
|
||||
bits[6] = (context->count[1] >> 16) & 0xFF;
|
||||
bits[7] = (context->count[1] >> 24) & 0xFF;
|
||||
bits[0] = (unsigned char) (context->count[0] & 0xFF);
|
||||
bits[1] = (unsigned char) ((context->count[0] >> 8) & 0xFF);
|
||||
bits[2] = (unsigned char) ((context->count[0] >> 16) & 0xFF);
|
||||
bits[3] = (unsigned char) ((context->count[0] >> 24) & 0xFF);
|
||||
bits[4] = (unsigned char) (context->count[1] & 0xFF);
|
||||
bits[5] = (unsigned char) ((context->count[1] >> 8) & 0xFF);
|
||||
bits[6] = (unsigned char) ((context->count[1] >> 16) & 0xFF);
|
||||
bits[7] = (unsigned char) ((context->count[1] >> 24) & 0xFF);
|
||||
|
||||
/* Pad out to 56 mod 64.
|
||||
*/
|
||||
@ -396,14 +396,14 @@ PHP_HASH_API void PHP_RIPEMD160Final(unsigned char digest[20], PHP_RIPEMD160_CTX
|
||||
unsigned int index, padLen;
|
||||
|
||||
/* Save number of bits */
|
||||
bits[0] = context->count[0] & 0xFF;
|
||||
bits[1] = (context->count[0] >> 8) & 0xFF;
|
||||
bits[2] = (context->count[0] >> 16) & 0xFF;
|
||||
bits[3] = (context->count[0] >> 24) & 0xFF;
|
||||
bits[4] = context->count[1] & 0xFF;
|
||||
bits[5] = (context->count[1] >> 8) & 0xFF;
|
||||
bits[6] = (context->count[1] >> 16) & 0xFF;
|
||||
bits[7] = (context->count[1] >> 24) & 0xFF;
|
||||
bits[0] = (unsigned char) (context->count[0] & 0xFF);
|
||||
bits[1] = (unsigned char) ((context->count[0] >> 8) & 0xFF);
|
||||
bits[2] = (unsigned char) ((context->count[0] >> 16) & 0xFF);
|
||||
bits[3] = (unsigned char) ((context->count[0] >> 24) & 0xFF);
|
||||
bits[4] = (unsigned char) (context->count[1] & 0xFF);
|
||||
bits[5] = (unsigned char) ((context->count[1] >> 8) & 0xFF);
|
||||
bits[6] = (unsigned char) ((context->count[1] >> 16) & 0xFF);
|
||||
bits[7] = (unsigned char) ((context->count[1] >> 24) & 0xFF);
|
||||
|
||||
/* Pad out to 56 mod 64.
|
||||
*/
|
||||
|
@ -553,14 +553,14 @@ PHP_HASH_API void PHP_SHA256Final(unsigned char digest[32], PHP_SHA256_CTX * con
|
||||
unsigned int index, padLen;
|
||||
|
||||
/* Save number of bits */
|
||||
bits[7] = context->count[0] & 0xFF;
|
||||
bits[6] = (context->count[0] >> 8) & 0xFF;
|
||||
bits[5] = (context->count[0] >> 16) & 0xFF;
|
||||
bits[4] = (context->count[0] >> 24) & 0xFF;
|
||||
bits[3] = context->count[1] & 0xFF;
|
||||
bits[2] = (context->count[1] >> 8) & 0xFF;
|
||||
bits[1] = (context->count[1] >> 16) & 0xFF;
|
||||
bits[0] = (context->count[1] >> 24) & 0xFF;
|
||||
bits[7] = (unsigned char) (context->count[0] & 0xFF);
|
||||
bits[6] = (unsigned char) ((context->count[0] >> 8) & 0xFF);
|
||||
bits[5] = (unsigned char) ((context->count[0] >> 16) & 0xFF);
|
||||
bits[4] = (unsigned char) ((context->count[0] >> 24) & 0xFF);
|
||||
bits[3] = (unsigned char) (context->count[1] & 0xFF);
|
||||
bits[2] = (unsigned char) ((context->count[1] >> 8) & 0xFF);
|
||||
bits[1] = (unsigned char) ((context->count[1] >> 16) & 0xFF);
|
||||
bits[0] = (unsigned char) ((context->count[1] >> 24) & 0xFF);
|
||||
|
||||
/* Pad out to 56 mod 64.
|
||||
*/
|
||||
|
@ -321,7 +321,7 @@ PHP_HASH_API void PHP_WHIRLPOOLUpdate(PHP_WHIRLPOOL_CTX *context, const unsigned
|
||||
*/
|
||||
bufferBits = bufferPos = 0;
|
||||
}
|
||||
buffer[bufferPos] = b << (8 - bufferRem);
|
||||
buffer[bufferPos] = (unsigned char) (b << (8 - bufferRem));
|
||||
bufferBits += bufferRem;
|
||||
/*
|
||||
* proceed to remaining data:
|
||||
@ -346,7 +346,7 @@ PHP_HASH_API void PHP_WHIRLPOOLUpdate(PHP_WHIRLPOOL_CTX *context, const unsigned
|
||||
* all remaining data fits on buffer[bufferPos],
|
||||
* and there still remains some space.
|
||||
*/
|
||||
bufferBits += sourceBits;
|
||||
bufferBits += (int) sourceBits;
|
||||
} else {
|
||||
/*
|
||||
* buffer[bufferPos] is full:
|
||||
@ -367,7 +367,7 @@ PHP_HASH_API void PHP_WHIRLPOOLUpdate(PHP_WHIRLPOOL_CTX *context, const unsigned
|
||||
*/
|
||||
bufferBits = bufferPos = 0;
|
||||
}
|
||||
buffer[bufferPos] = b << (8 - bufferRem);
|
||||
buffer[bufferPos] = (unsigned char) (b << (8 - bufferRem));
|
||||
bufferBits += (int)sourceBits;
|
||||
}
|
||||
context->buffer.bits = bufferBits;
|
||||
|
@ -30,9 +30,9 @@
|
||||
|
||||
#define PHP_HASH_HMAC 0x0001
|
||||
|
||||
typedef int (*php_hash_init_func_t)(void *context);
|
||||
typedef int (*php_hash_update_func_t)(void *context, const unsigned char *buf, unsigned int count);
|
||||
typedef int (*php_hash_final_func_t)(unsigned char *digest, void *context);
|
||||
typedef void (*php_hash_init_func_t)(void *context);
|
||||
typedef void (*php_hash_update_func_t)(void *context, const unsigned char *buf, unsigned int count);
|
||||
typedef void (*php_hash_final_func_t)(unsigned char *digest, void *context);
|
||||
|
||||
typedef struct _php_hash_ops {
|
||||
php_hash_init_func_t hash_init;
|
||||
|
@ -1,3 +1,20 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| PHP Version 5 |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1997-2005 The PHP Group |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 3.0 of the PHP license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.php.net/license/3_0.txt. |
|
||||
| If you did not receive a copy of the PHP license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@php.net so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Author: Michael Wallner <mike@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
@ -8,7 +25,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#ifndef PHP_WIN32
|
||||
#if SIZEOF_LONG == 8
|
||||
#define L64(x) x
|
||||
typedef unsigned long php_hash_uint64;
|
||||
@ -29,6 +46,8 @@ typedef unsigned long php_hash_uint32;
|
||||
#else
|
||||
#error "Need a 32bit integer type"
|
||||
#endif
|
||||
#else
|
||||
#error "Need a 64bit integer type"
|
||||
#endif
|
||||
#else
|
||||
#define L64(x) x##i64
|
||||
@ -38,3 +57,11 @@ typedef unsigned __int32 php_hash_uint32;
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* End:
|
||||
* vim600: sw=4 ts=4 fdm=marker
|
||||
* vim<600: sw=4 ts=4
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user