Skip to content

Commit 87c6c7c

Browse files
committed
Added portability warnings and removed typedef 16bit
1 parent 73599b0 commit 87c6c7c

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

hpcopr/now_md5.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@
1010

1111
#define FILEIO_BUFFER_SIZE 67108864 /* 64MB maximum memory buffer*/
1212

13+
/**
14+
* Portability risk: The unsigned int does not always has 32 bits. It is *NOT*
15+
* defined by standards. We assert that on all the target platforms of this
16+
* project, that is, x86_64 with Windows/Linux/macOS, the unsigned int is 32 bit.
17+
* This is an assertion! If you encounter any portability problems, please
18+
* submit issues to this repository.
19+
*
20+
*/
1321
typedef unsigned char uint_8bit;
14-
typedef unsigned short uint_16bit;
1522
typedef unsigned int uint_32bit;
1623
typedef unsigned long long int uint_64bit;
1724
typedef signed long long int int_64bit;

hpcopr/now_sha256.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@
1010

1111
#define FILEIO_BUFFER_SIZE_SHA 67108864 /* 64MB maximum memory buffer*/
1212

13+
/**
14+
* Portability risk: The unsigned int does not always has 32 bits. It is *NOT*
15+
* defined by standards. We assert that on all the target platforms of this
16+
* project, that is, x86_64 with Windows/Linux/macOS, the unsigned int is 32 bit.
17+
* This is an assertion! If you encounter any portability problems, please
18+
* submit issues to this repository.
19+
*
20+
*/
1321
typedef unsigned char uint_8bit;
14-
typedef unsigned short uint_16bit;
1522
typedef unsigned int uint_32bit;
1623
typedef unsigned long long int uint_64bit;
1724
typedef signed long long int int_64bit;

now-crypto/now-crypto-v3-aes.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,16 @@
2525

2626
#define CRYPTO_VERSION "0.3.0"
2727

28+
/**
29+
* Portability risk: The unsigned int does not always has 32 bits. It is *NOT*
30+
* defined by standards. We assert that on all the target platforms of this
31+
* project, that is, x86_64 with Windows/Linux/macOS, the unsigned int is 32 bit.
32+
* This is an assertion! If you encounter any portability problems, please
33+
* submit issues to this repository.
34+
*
35+
*/
2836
typedef unsigned char uint_8bit;
29-
typedef unsigned short uint_16bit;
3037
typedef unsigned int uint_32bit;
31-
typedef unsigned long int uint_64bit;
3238

3339
/* Each expanded key is in format of 0xAABBCCDD, so 4X8bit=32bit */
3440
typedef struct{

0 commit comments

Comments
 (0)