diff options
author | Rich Salz <rsalz@openssl.org> | 2017-12-08 15:08:43 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-12-08 15:08:43 -0500 |
commit | c6738fd208c143939b6bb7f7ac2061c0f5ff3272 (patch) | |
tree | a270d65f499b082d936057e1201acf76c98f570a | |
parent | a1daedd88445397a4aebf22ba63e92c3f1977870 (diff) |
Standardize syntax around sizeof(foo)
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4875)
118 files changed, 499 insertions, 497 deletions
diff --git a/MacOS/Randomizer.cpp b/MacOS/Randomizer.cpp index cceb6bde44..52dc8842e8 100644 --- a/MacOS/Randomizer.cpp +++ b/MacOS/Randomizer.cpp @@ -266,7 +266,7 @@ void CRandomizer::AddCurrentMouse (void) if (labs (mLastMouse.h - mouseLoc.h) > kMouseResolution/2 && labs (mLastMouse.v - mouseLoc.v) > kMouseResolution/2) - AddBytes (&mouseLoc, sizeof (mouseLoc), + AddBytes (&mouseLoc, sizeof(mouseLoc), kMousePositionEntropy); if (mLastMouse.h == mouseLoc.h && mLastMouse.v == mouseLoc.v) @@ -286,7 +286,7 @@ void CRandomizer::AddCurrentMouse (void) (kTypicalMouseIdleTicks/(double)lastCheck); if (entropy < 0.0) entropy = 0.0; - AddBytes (&mMouseStill, sizeof (mMouseStill), entropy); + AddBytes (&mMouseStill, sizeof(mMouseStill), entropy); mMouseStill = 0; } mLastMouse = mouseLoc; @@ -299,7 +299,7 @@ void CRandomizer::AddAbsoluteSystemStartupTime (void) GetDateTime (&now); now -= TickCount() / 60; // Time in ticks since machine // startup - AddBytes (&now, sizeof (now), kSysStartupEntropy); + AddBytes (&now, sizeof(now), kSysStartupEntropy); } void CRandomizer::AddTimeSinceMachineStartup (void) @@ -314,7 +314,7 @@ void CRandomizer::AddAppRunningTime (void) ProcessSerialNumber PSN; ProcessInfoRec ProcessInfo; - ProcessInfo.processInfoLength = sizeof (ProcessInfoRec); + ProcessInfo.processInfoLength = sizeof(ProcessInfoRec); ProcessInfo.processName = nil; ProcessInfo.processAppSpec = nil; @@ -324,7 +324,7 @@ void CRandomizer::AddAppRunningTime (void) // Now add the amount of time in ticks that the current process // has been active - AddBytes (&ProcessInfo, sizeof (ProcessInfoRec), + AddBytes (&ProcessInfo, sizeof(ProcessInfoRec), kApplicationUpTimeEntropy); } @@ -353,7 +353,7 @@ void CRandomizer::AddStartupVolumeInfo (void) // unpredictable, so might as well toss the whole block in. See // comments for entropy estimate justifications. - AddBytes (&pb, sizeof (pb), + AddBytes (&pb, sizeof(pb), kVolumeBytesEntropy + log2l (((pb.ioVTotalBytes.hi - pb.ioVFreeBytes.hi) * 4294967296.0D + @@ -419,7 +419,7 @@ void CRandomizer::AddBytes (void *data, long size, double entropy) void CRandomizer::AddNow (double millisecondUncertainty) { long time = SysTimer(); - AddBytes (&time, sizeof (time), log2l (millisecondUncertainty * + AddBytes (&time, sizeof(time), log2l (millisecondUncertainty * mTimebaseTicksPerMillisec)); } diff --git a/apps/app_rand.c b/apps/app_rand.c index 7f40bba764..0bbf342e7e 100644 --- a/apps/app_rand.c +++ b/apps/app_rand.c @@ -128,7 +128,7 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn) #endif if (file == NULL) - file = RAND_file_name(buffer, sizeof buffer); + file = RAND_file_name(buffer, sizeof(buffer)); else if (RAND_egd(file) > 0) { /* * we try if the given filename is an EGD socket. if it is, we don't @@ -203,7 +203,7 @@ int app_RAND_write_file(const char *file, BIO *bio_e) return 0; if (file == NULL) - file = RAND_file_name(buffer, sizeof buffer); + file = RAND_file_name(buffer, sizeof(buffer)); if (file == NULL || !RAND_write_file(file)) { BIO_printf(bio_e, "unable to write 'random state'\n"); return 0; diff --git a/apps/apps.c b/apps/apps.c index 29de1b75dd..c5a5152295 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -1738,9 +1738,9 @@ int save_serial(char *serialfile, char *suffix, BIGNUM *serial, BUF_strlcpy(buf[0], serialfile, BSIZE); else { #ifndef OPENSSL_SYS_VMS - j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix); + j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, suffix); #else - j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, suffix); + j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, suffix); #endif } #ifdef RL_DEBUG @@ -1789,14 +1789,14 @@ int rotate_serial(char *serialfile, char *new_suffix, char *old_suffix) goto err; } #ifndef OPENSSL_SYS_VMS - j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, new_suffix); + j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, new_suffix); #else - j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, new_suffix); + j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, new_suffix); #endif #ifndef OPENSSL_SYS_VMS - j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s", serialfile, old_suffix); + j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", serialfile, old_suffix); #else - j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s", serialfile, old_suffix); + j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", serialfile, old_suffix); #endif #ifdef RL_DEBUG BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n", |