Browse Source

remove compiler warnings

master
Felix von Leitner 8 years ago
parent
commit
603801caf1
  1. 4
      uint/uint16_pack.c
  2. 4
      uint/uint16_pack_big.c
  3. 2
      uint/uint16_read.c
  4. 2
      uint/uint16_read_big.c
  5. 2
      uint/uint16_unpack.c
  6. 2
      uint/uint16_unpack_big.c
  7. 8
      uint/uint32_pack.c
  8. 8
      uint/uint32_pack_big.c
  9. 2
      uint/uint64_pack.c
  10. 2
      uint/uint64_pack_big.c

4
uint/uint16_pack.c

@ -2,6 +2,6 @@
#include "uint16.h"
void uint16_pack(char *out,uint16 in) {
out[0]=in&255;
out[1]=in>>8;
out[0]=(char)in;
out[1]=(char)(in>>8);
}

4
uint/uint16_pack_big.c

@ -2,6 +2,6 @@
#include "uint16.h"
void uint16_pack_big(char *out,uint16 in) {
out[0]=in>>8;
out[1]=in&255;
out[0]=(char)(in>>8);
out[1]=(char)in;
}

2
uint/uint16_read.c

@ -2,5 +2,5 @@
#include "uint16.h"
uint16 uint16_read(const char *in) {
return ((unsigned short)((unsigned char) in[1]) << 8) + (unsigned char)in[0];
return (unsigned short)((((unsigned char) in[1]) << 8) | (unsigned char)in[0]);
}

2
uint/uint16_read_big.c

@ -2,5 +2,5 @@
#include "uint16.h"
uint16 uint16_read_big(const char *in) {
return ((unsigned short)((unsigned char) in[0]) << 8) + (unsigned char)in[1];
return (unsigned short)((((unsigned char) in[0]) << 8) + (unsigned char)in[1]);
}

2
uint/uint16_unpack.c

@ -2,5 +2,5 @@
#include "uint16.h"
void uint16_unpack(const char *in,uint16 *out) {
*out = ((unsigned short)((unsigned char) in[1]) << 8) + (unsigned char)in[0];
*out = (unsigned short)((((unsigned char) in[1]) << 8) + (unsigned char)in[0]);
}

2
uint/uint16_unpack_big.c

@ -2,5 +2,5 @@
#include "uint16.h"
void uint16_unpack_big(const char *in,uint16 *out) {
*out = ((unsigned short)((unsigned char) in[0]) << 8) + (unsigned char)in[1];
*out = (unsigned short)((((unsigned char) in[0]) << 8) + (unsigned char)in[1]);
}

8
uint/uint32_pack.c

@ -2,8 +2,8 @@
#include "uint32.h"
void uint32_pack(char *out,uint32 in) {
*out=in&0xff; in>>=8;
*++out=in&0xff; in>>=8;
*++out=in&0xff; in>>=8;
*++out=in&0xff;
*out=(char)in; in>>=8;
*++out=(char)in; in>>=8;
*++out=(char)in; in>>=8;
*++out=(char)in;
}

8
uint/uint32_pack_big.c

@ -2,8 +2,8 @@
#include "uint32.h"
void uint32_pack_big(char *out,uint32 in) {
out[3]=in&0xff; in>>=8;
out[2]=in&0xff; in>>=8;
out[1]=in&0xff; in>>=8;
out[0]=in&0xff;
out[3]=(char)in; in>>=8;
out[2]=(char)in; in>>=8;
out[1]=(char)in; in>>=8;
out[0]=(char)in;
}

2
uint/uint64_pack.c

@ -4,5 +4,5 @@
void uint64_pack(char *out,uint64 in) {
uint32_pack(out,in&0xffffffff);
uint32_pack(out+4,in>>32);
uint32_pack(out+4,(uint32)(in>>32));
}

2
uint/uint64_pack_big.c

@ -3,6 +3,6 @@
#include "uint32.h"
void uint64_pack_big(char *out,uint64 in) {
uint32_pack_big(out,in>>32);
uint32_pack_big(out,(uint32)(in>>32));
uint32_pack_big(out+4,in&0xffffffff);
}

Loading…
Cancel
Save