diff --git a/core/src/filed/crypto.cc b/core/src/filed/crypto.cc index c9168e17f17..12559336fec 100644 --- a/core/src/filed/crypto.cc +++ b/core/src/filed/crypto.cc @@ -604,8 +604,8 @@ bool DecryptData(JobControlRecord* jcr, /* * Decrypt the input block */ - if (!CryptoCipherUpdate(cipher_ctx->cipher, (const u_int8_t*)*data, *length, - (u_int8_t*)&cipher_ctx->buf[cipher_ctx->buf_len], + if (!CryptoCipherUpdate(cipher_ctx->cipher, (const uint8_t*)*data, *length, + (uint8_t*)&cipher_ctx->buf[cipher_ctx->buf_len], &decrypted_len)) { /* * Decryption failed. Shouldn't happen. diff --git a/core/src/lib/bmtio.h b/core/src/lib/bmtio.h index 92bb4f12dc6..e099e04c389 100644 --- a/core/src/lib/bmtio.h +++ b/core/src/lib/bmtio.h @@ -123,7 +123,7 @@ struct mtget { #if defined(__FreeBSD__) int32_t mt_blksiz; /**< presently operating blocksize */ int32_t mt_density; /**< presently operating density */ - u_int32_t mt_comp; /**< presently operating compression */ + uint32_t mt_comp; /**< presently operating compression */ int32_t mt_blksiz0; /**< blocksize for mode 0 */ int32_t mt_blksiz1; /**< blocksize for mode 1 */ int32_t mt_blksiz2; /**< blocksize for mode 2 */ @@ -133,10 +133,10 @@ struct mtget { int32_t mt_density2; /**< density for mode 2 */ int32_t mt_density3; /**< density for mode 3 */ /* the following are not yet implemented */ - u_int32_t mt_comp0; /**< compression type for mode 0 */ - u_int32_t mt_comp1; /**< compression type for mode 1 */ - u_int32_t mt_comp2; /**< compression type for mode 2 */ - u_int32_t mt_comp3; /**< compression type for mode 3 */ + uint32_t mt_comp0; /**< compression type for mode 0 */ + uint32_t mt_comp1; /**< compression type for mode 1 */ + uint32_t mt_comp2; /**< compression type for mode 2 */ + uint32_t mt_comp3; /**< compression type for mode 3 */ /* end not yet implemented */ #endif int32_t mt_fileno; /**< relative file number of current position */ @@ -151,23 +151,23 @@ struct scsi_tape_errors { * Check Condition noted for these operations. The act * of issuing an MTIOCERRSTAT unlatches and clears them. */ - u_int8_t io_sense[32]; /**< Last Sense Data For Data I/O */ + uint8_t io_sense[32]; /**< Last Sense Data For Data I/O */ int32_t io_resid; /**< residual count from last Data I/O */ - u_int8_t io_cdb[16]; /**< Command that Caused the Last Data Sense */ - u_int8_t ctl_sense[32]; /**< Last Sense Data For Control I/O */ + uint8_t io_cdb[16]; /**< Command that Caused the Last Data Sense */ + uint8_t ctl_sense[32]; /**< Last Sense Data For Control I/O */ int32_t ctl_resid; /**< residual count from last Control I/O */ - u_int8_t ctl_cdb[16]; /**< Command that Caused the Last Control Sense */ + uint8_t ctl_cdb[16]; /**< Command that Caused the Last Control Sense */ /* * These are the read and write cumulative error counters. * (how to reset cumulative error counters is not yet defined). * (not implemented as yet but space is being reserved for them) */ struct { - u_int32_t retries; /**< total # retries performed */ - u_int32_t corrected; /**< total # corrections performed */ - u_int32_t processed; /**< total # corrections successful */ - u_int32_t failures; /**< total # corrections/retries failed */ - u_int64_t nbytes; /**< total # bytes processed */ + uint32_t retries; /**< total # retries performed */ + uint32_t corrected; /**< total # corrections performed */ + uint32_t processed; /**< total # corrections successful */ + uint32_t failures; /**< total # corrections/retries failed */ + uint64_t nbytes; /**< total # bytes processed */ } wterr, rderr; }; @@ -213,18 +213,18 @@ union mterrstat { * rethink these ioctls to support all the entities they haul into * the picture (64 bit blocks, logical file record numbers, etc..). */ -#define MTIOCRDSPOS _IOR('m', 5, u_int32_t) /**< get logical blk addr */ -#define MTIOCRDHPOS _IOR('m', 6, u_int32_t) /**< get hardware blk addr */ -#define MTIOCSLOCATE _IOW('m', 5, u_int32_t) /**< seek to logical blk addr */ -#define MTIOCHLOCATE _IOW('m', 6, u_int32_t) /**< seek to hardware blk addr */ +#define MTIOCRDSPOS _IOR('m', 5, uint32_t) /**< get logical blk addr */ +#define MTIOCRDHPOS _IOR('m', 6, uint32_t) /**< get hardware blk addr */ +#define MTIOCSLOCATE _IOW('m', 5, uint32_t) /**< seek to logical blk addr */ +#define MTIOCHLOCATE _IOW('m', 6, uint32_t) /**< seek to hardware blk addr */ #define MTIOCERRSTAT _IOR('m', 7, union mterrstat) /**< get tape errors */ /* * Set EOT model- argument is number of filemarks to end a tape with. * Note that not all possible values will be accepted. */ -#define MTIOCSETEOTMODEL _IOW('m', 8, u_int32_t) +#define MTIOCSETEOTMODEL _IOW('m', 8, uint32_t) /* Get current EOT model */ -#define MTIOCGETEOTMODEL _IOR('m', 8, u_int32_t) +#define MTIOCGETEOTMODEL _IOR('m', 8, uint32_t) #ifndef _KERNEL #define DEFTAPE "/dev/nsa0" diff --git a/core/src/lib/crypto_none.cc b/core/src/lib/crypto_none.cc index 1f66d328e31..d1f56053566 100644 --- a/core/src/lib/crypto_none.cc +++ b/core/src/lib/crypto_none.cc @@ -79,7 +79,7 @@ bool CryptoDigestUpdate(DIGEST* digest, const uint8_t* data, uint32_t length) return true; case CRYPTO_DIGEST_SHA1: /* Doesn't return anything ... */ - SHA1Update(&digest->sha1, (const u_int8_t*)data, (unsigned int)length); + SHA1Update(&digest->sha1, (const uint8_t*)data, (unsigned int)length); return true; default: return false; @@ -102,7 +102,7 @@ bool CryptoDigestFinalize(DIGEST* digest, uint8_t* dest, uint32_t* length) * an out-of-sync CRYPTO_DIGEST_MAX_SIZE */ assert(*length >= CRYPTO_DIGEST_SHA1_SIZE); *length = CRYPTO_DIGEST_SHA1_SIZE; - SHA1Final((u_int8_t*)dest, &digest->sha1); + SHA1Final((uint8_t*)dest, &digest->sha1); return true; default: return false; diff --git a/core/src/lib/crypto_nss.cc b/core/src/lib/crypto_nss.cc index 97bfeba2e97..1ec16e39651 100644 --- a/core/src/lib/crypto_nss.cc +++ b/core/src/lib/crypto_nss.cc @@ -81,7 +81,7 @@ bool CryptoDigestUpdate(DIGEST* digest, const uint8_t* data, uint32_t length) return true; case CRYPTO_DIGEST_SHA1: /* Doesn't return anything ... */ - SHA1Update(&digest->sha1, (const u_int8_t*)data, (unsigned int)length); + SHA1Update(&digest->sha1, (const uint8_t*)data, (unsigned int)length); return true; default: return false; @@ -104,7 +104,7 @@ bool CryptoDigestFinalize(DIGEST* digest, uint8_t* dest, uint32_t* length) * an out-of-sync CRYPTO_DIGEST_MAX_SIZE */ assert(*length >= CRYPTO_DIGEST_SHA1_SIZE); *length = CRYPTO_DIGEST_SHA1_SIZE; - SHA1Final((u_int8_t*)dest, &digest->sha1); + SHA1Final((uint8_t*)dest, &digest->sha1); return true; default: return false; diff --git a/core/src/lib/scsi_lli.cc b/core/src/lib/scsi_lli.cc index 3e86c4eb3d1..f567f5c5724 100644 --- a/core/src/lib/scsi_lli.cc +++ b/core/src/lib/scsi_lli.cc @@ -338,7 +338,7 @@ static inline bool do_scsi_cmd_page(int fd, NULL, /* cbfcnp */ direction, /* flags */ MSG_SIMPLE_Q_TAG, /* tagaction */ - (u_int8_t*)cmd_page, /* dataptr */ + (uint8_t*)cmd_page, /* dataptr */ cmd_page_len, /* datalen */ sizeof(sense), /* senselength */ cdb_len, /* cdblength */ diff --git a/core/src/lib/sha1.cc b/core/src/lib/sha1.cc index 317a62ef790..88d0c2ffa79 100644 --- a/core/src/lib/sha1.cc +++ b/core/src/lib/sha1.cc @@ -27,7 +27,7 @@ A million repetitions of "a" #include "sha1.h" -void SHA1Transform(u_int32_t state[5], const u_int8_t buffer[64]); +void SHA1Transform(uint32_t state[5], const uint8_t buffer[64]); #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) @@ -65,16 +65,16 @@ void SHA1Transform(u_int32_t state[5], const u_int8_t buffer[64]); /* Hash a single 512-bit block. This is the core of the algorithm. */ -void SHA1Transform(u_int32_t state[5], const u_int8_t buffer[64]) +void SHA1Transform(uint32_t state[5], const uint8_t buffer[64]) { - u_int32_t a, b, c, d, e; + uint32_t a, b, c, d, e; typedef union { - u_int8_t c[64]; - u_int32_t l[16]; + uint8_t c[64]; + uint32_t l[16]; } CHAR64LONG16; CHAR64LONG16* block; #ifdef SHA1HANDSOFF - static u_int8_t workspace[64]; + static uint8_t workspace[64]; block = (CHAR64LONG16*)workspace; memcpy(block, buffer, 64); #else @@ -194,7 +194,7 @@ void SHA1Init(SHA1_CTX* context) /* Run your data through this. */ -void SHA1Update(SHA1_CTX* context, const u_int8_t* data, unsigned int len) +void SHA1Update(SHA1_CTX* context, const uint8_t* data, unsigned int len) { unsigned int i, j; @@ -214,24 +214,24 @@ void SHA1Update(SHA1_CTX* context, const u_int8_t* data, unsigned int len) /* Add padding and return the message digest. */ -void SHA1Final(u_int8_t digest[20], SHA1_CTX* context) +void SHA1Final(uint8_t digest[20], SHA1_CTX* context) { - u_int32_t i, j; - u_int8_t finalcount[8]; + uint32_t i, j; + uint8_t finalcount[8]; for (i = 0; i < 8; i++) { finalcount[i] = - (u_int8_t)((context->count[(i >= 4 ? 0 : 1)] >> ((3 - (i & 3)) * 8)) & + (uint8_t)((context->count[(i >= 4 ? 0 : 1)] >> ((3 - (i & 3)) * 8)) & 255); /* Endian independent */ } - SHA1Update(context, (u_int8_t*)"\200", 1); + SHA1Update(context, (uint8_t*)"\200", 1); while ((context->count[0] & 504) != 448) { - SHA1Update(context, (u_int8_t*)"\0", 1); + SHA1Update(context, (uint8_t*)"\0", 1); } SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */ for (i = 0; i < 20; i++) { digest[i] = - (u_int8_t)((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); + (uint8_t)((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); } /* Wipe variables */ i = j = 0; diff --git a/core/src/lib/sha1.h b/core/src/lib/sha1.h index 1cea95a7a34..6656624d74f 100644 --- a/core/src/lib/sha1.h +++ b/core/src/lib/sha1.h @@ -15,13 +15,13 @@ #define SHA1_DIGEST_LENGTH 20 typedef struct { - u_int32_t state[5]; - u_int32_t count[2]; + uint32_t state[5]; + uint32_t count[2]; unsigned char buffer[SHA1_BLOCK_LENGTH]; } SHA1_CTX; void SHA1Init(SHA1_CTX* context); -void SHA1Transform(u_int32_t state[5], +void SHA1Transform(uint32_t state[5], const unsigned char buffer[SHA1_BLOCK_LENGTH]); void SHA1Update(SHA1_CTX* context, const unsigned char* data, unsigned int len); void SHA1Final(unsigned char digest[SHA1_DIGEST_LENGTH], SHA1_CTX* context); diff --git a/core/src/ndmp/ndmos_freebsd.c b/core/src/ndmp/ndmos_freebsd.c index 040051f1fab..a8038baf134 100644 --- a/core/src/ndmp/ndmos_freebsd.c +++ b/core/src/ndmp/ndmos_freebsd.c @@ -174,11 +174,11 @@ ndmp9_error ndmos_scsi_execute_cdb(struct ndm_session* sess, struct ndm_robot_agent* robot = sess->robot_acb; struct cam_device* camdev = robot->camdev; union ccb* ccb; - u_int32_t flags; - u_int8_t* data_ptr = 0; - u_int8_t* data_in_ptr = 0; - u_int32_t data_len = 0; - u_int32_t data_done; + uint32_t flags; + uint8_t* data_ptr = 0; + uint8_t* data_in_ptr = 0; + uint32_t data_len = 0; + uint32_t data_done; int rc; NDMOS_MACRO_ZEROFILL(reply); @@ -203,7 +203,7 @@ ndmp9_error ndmos_scsi_execute_cdb(struct ndm_session* sess, } data_len = request->datain_len; - data_in_ptr = (u_int8_t*)malloc(data_len); + data_in_ptr = (uint8_t*)malloc(data_len); if (!data_in_ptr) { reply->error = NDMP9_NO_MEM_ERR; @@ -215,7 +215,7 @@ ndmp9_error ndmos_scsi_execute_cdb(struct ndm_session* sess, case NDMP9_SCSI_DATA_DIR_OUT: data_len = request->dataout.dataout_len; - data_ptr = (u_int8_t*)request->dataout.dataout_val; + data_ptr = (uint8_t*)request->dataout.dataout_val; flags = CAM_DIR_OUT; break;