X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=oss%2Fcatdoc.git;a=blobdiff_plain;f=src%2Fnumutils.c;fp=src%2Fnumutils.c;h=9f9ca175c9321c7477691011cf60c9cd8787e97e;hp=9376f35c5891e975d3797bf8016abc00488aa6d6;hb=d106443a3be63ce39f77b281eb80e85e54141e03;hpb=e2020c47c14a8a03f44734a6c0adc48fb5129c2f diff --git a/src/numutils.c b/src/numutils.c index 9376f35..9f9ca17 100644 --- a/src/numutils.c +++ b/src/numutils.c @@ -5,25 +5,25 @@ /* This file is part of catdoc project */ /* (c) Victor Wagner 1996-2003, (c) Alex Ott 2003 */ /*****************************************************************/ - +#include "catdoc.h" /********************************************************************/ /* Reads 2-byte LSB int from buffer at given offset platfom-indepent * way *********************************************************************/ -unsigned int getshort(unsigned char *buffer,int offset) { +uint16_t getshort(unsigned char *buffer,int offset) { return (unsigned short int)buffer[offset]|((unsigned short int)buffer[offset+1]<<8); } /********************************************************************/ /* Reads 4-byte LSB int from buffer at given offset almost platfom-indepent * way *********************************************************************/ -long int getlong(unsigned char *buffer,int offset) { +int32_t getlong(unsigned char *buffer,int offset) { return (long)buffer[offset]|((long)buffer[offset+1]<<8L) |((long)buffer[offset+2]<<16L)|((long)buffer[offset+3]<<24L); } -unsigned long int getulong(unsigned char *buffer,int offset) { +uint32_t getulong(unsigned char *buffer,int offset) { return (unsigned long)buffer[offset]|((unsigned long)buffer[offset+1]<<8L) |((unsigned long)buffer[offset+2]<<16L)|((unsigned long)buffer[offset+3]<<24L); }