Commit 5bf88f34 authored by Matteo Quintiliani's avatar Matteo Quintiliani

Substitude long with int32_t


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@201 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent f98ab6d9
......@@ -63,9 +63,11 @@
#ifndef NMXP_CRC32_H
#define NMXP_CRC32_H 1
#include <stdint.h>
/*! \brief Computes a 32 bit crc of the data in the buffer,
* and returns the crc. the polynomial used is 0xedb88320. */
unsigned long crc32(const unsigned char *buf, unsigned int len);
uint32_t crc32(const unsigned char *buf, unsigned int len);
#endif /* CRC32_H */
......
......@@ -176,9 +176,9 @@ int nmxp_readConnectionTime(int isock, int32_t *connection_time) {
int nmxp_waitReady(int isock) {
int times = 0;
int rc = NMXP_SOCKET_OK;
unsigned long signature;
unsigned long type = 0;
unsigned long length;
uint32_t signature;
uint32_t type = 0;
uint32_t length;
while(rc == NMXP_SOCKET_OK && type != NMXP_MSG_READY) {
rc = nmxp_recv_ctrl(isock, &signature, sizeof(signature));
......
#include "nmxp_crc32.h"
static unsigned long crc32_tab[] = {
static uint32_t crc32_tab[] = {
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
......@@ -57,10 +57,10 @@ static unsigned long crc32_tab[] = {
};
unsigned long crc32(const unsigned char *s, unsigned int len)
uint32_t crc32(const unsigned char *s, unsigned int len)
{
unsigned int i;
unsigned long crc32val;
uint32_t crc32val;
crc32val = 0;
for (i = 0; i < len; i ++)
......
......@@ -317,7 +317,7 @@ int nmxp_data_parse_date(const char *pstr_date, struct tm *ret_tm) {
char err_message[MAX_LENGTH_ERR_MESSAGE] = "NO MESSAGE";
char *pEnd = NULL;
long int app;
int32_t app;
int state;
int flag_finished = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment