Merge pull request #19 from ShabbyX/master
Correct usage of ll in %d and %x
This commit is contained in:
commit
1654afc75f
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "ethercattype.h"
|
||||
#include "nicdrv.h"
|
||||
|
@ -155,7 +156,7 @@ char* SDO2string(uint16 slave, uint16 index, uint8 subidx, uint16 dtype)
|
|||
break;
|
||||
case ECT_INTEGER64:
|
||||
i64 = (int64*) &usdo[0];
|
||||
sprintf(hstr, "0x%16.16llx %lld", *i64, *i64);
|
||||
sprintf(hstr, "0x%16.16"PRIx64" %"PRId64, *i64, *i64);
|
||||
break;
|
||||
case ECT_UNSIGNED8:
|
||||
u8 = (uint8*) &usdo[0];
|
||||
|
@ -172,7 +173,7 @@ char* SDO2string(uint16 slave, uint16 index, uint8 subidx, uint16 dtype)
|
|||
break;
|
||||
case ECT_UNSIGNED64:
|
||||
u64 = (uint64*) &usdo[0];
|
||||
sprintf(hstr, "0x%16.16llx %llu", *u64, *u64);
|
||||
sprintf(hstr, "0x%16.16"PRIx64" %"PRIu64, *u64, *u64);
|
||||
break;
|
||||
case ECT_REAL32:
|
||||
sr = (float*) &usdo[0];
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "ethercattype.h"
|
||||
#include "nicdrv.h"
|
||||
|
@ -155,7 +156,7 @@ char* SDO2string(uint16 slave, uint16 index, uint8 subidx, uint16 dtype)
|
|||
break;
|
||||
case ECT_INTEGER64:
|
||||
i64 = (int64*) &usdo[0];
|
||||
sprintf(hstr, "0x%16.16llx %lld", *i64, *i64);
|
||||
sprintf(hstr, "0x%16.16"PRIx64" %"PRId64, *i64, *i64);
|
||||
break;
|
||||
case ECT_UNSIGNED8:
|
||||
u8 = (uint8*) &usdo[0];
|
||||
|
@ -172,7 +173,7 @@ char* SDO2string(uint16 slave, uint16 index, uint8 subidx, uint16 dtype)
|
|||
break;
|
||||
case ECT_UNSIGNED64:
|
||||
u64 = (uint64*) &usdo[0];
|
||||
sprintf(hstr, "0x%16.16llx %llu", *u64, *u64);
|
||||
sprintf(hstr, "0x%16.16"PRIx64" %"PRIu64, *u64, *u64);
|
||||
break;
|
||||
case ECT_REAL32:
|
||||
sr = (float*) &usdo[0];
|
||||
|
|
Loading…
Reference in New Issue