]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Readability improvements for winRandomness.
authormistachkin <mistachkin@noemail.net>
Mon, 15 Feb 2016 22:37:18 +0000 (22:37 +0000)
committermistachkin <mistachkin@noemail.net>
Mon, 15 Feb 2016 22:37:18 +0000 (22:37 +0000)
FossilOrigin-Name: 1640f814c7a5210f08c81e52e5a3fb89ac26f4d4

manifest
manifest.uuid
src/os_win.c

index dc579b914c4e745b8a5dacb9aec23126141081a9..429035ea4b96d6c9a172c534ef25609dd9065fd2 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\scomment.\s\sNo\schanges\sto\scode.
-D 2016-02-15T22:28:50.979
+C Readability\simprovements\sfor\swinRandomness.
+D 2016-02-15T22:37:18.018
 F Makefile.in 4e90dc1521879022aa9479268a4cd141d1771142
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc 30f075dc4f27a07abb76088946b2944178d85347
@@ -333,7 +333,7 @@ F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
 F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
 F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
 F src/os_unix.c 3a6f20736dfb8a0949cdd66553fdf59f6604be35
-F src/os_win.c 1a781c2362ce07bcb6b3cd4b0c51c833eff70189
+F src/os_win.c f0d7aa603eb6262143d7169a222aea07c4fca91d
 F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
 F src/pager.c 6812f3803951774b56abded396171e1c12b0b003
 F src/pager.h f3eb324a3ff2408b28bab7e81c1c55c13720f865
@@ -1427,7 +1427,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh a98af506df552f3b3c0d904f94e4cdc4e1a6d598
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 287f508dd6abc1b9ffdbec6a685ebe79eeac992b
-R 9d5f50ad392123c1263322df3a641869
+P 2e1f2eff27e25280fe626c07b6260b0a7aa903d3
+R dd8a80ac652728cd502c81c91874767f
 U mistachkin
-Z 47f9e57e8f4d3a40a70b451a66c69ad4
+Z 8e4d3c615023f7e6ecbb584ba3188e53
index a280efdfb020b4eea2e64537d08e6bcad70a0f20..492babb232125a43ab7acc4893ca430519665d2e 100644 (file)
@@ -1 +1 @@
-2e1f2eff27e25280fe626c07b6260b0a7aa903d3
\ No newline at end of file
+1640f814c7a5210f08c81e52e5a3fb89ac26f4d4
\ No newline at end of file
index f93fa2458923c6caa6f6139d4eeccf0248bcfc8c..af6b1c814c64c58aa5f1e885427bfc586ef19b9f 100644 (file)
@@ -5410,7 +5410,7 @@ static void xorMemory(EntropyGatherer *p, unsigned char *x, int sz){
   p->i = k;
   p->nXor += sz;
 }
-#endif
+#endif /* !defined(SQLITE_TEST) && !defined(SQLITE_OMIT_RANDOMNESS) */
 
 /*
 ** Write up to nBuf bytes of randomness into zBuf.
@@ -5426,7 +5426,7 @@ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
   memset(zBuf, 0, nBuf);
 #if defined(_MSC_VER) && _MSC_VER>=1400
   rand_s((int*)zBuf); /* rand_s() is not available with MinGW */
-#endif
+#endif /* defined(_MSC_VER) && _MSC_VER>=1400 */
   e.a = (unsigned char*)zBuf;
   e.na = nBuf;
   e.nXor = 0;
@@ -5434,27 +5434,27 @@ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
   {
     SYSTEMTIME x;
     osGetSystemTime(&x);
-    xorMemory(&e, (unsigned char*)&x, sizeof(x));
+    xorMemory(&e, (unsigned char*)&x, sizeof(SYSTEMTIME));
   }
   {
     DWORD pid = osGetCurrentProcessId();
-    xorMemory(&e, (unsigned char*)&pid, sizeof(pid));
+    xorMemory(&e, (unsigned char*)&pid, sizeof(DWORD));
   }
 #if SQLITE_OS_WINRT
   {
     ULONGLONG cnt = osGetTickCount64();
-    xorMemory(&e, (unsigned char*)&cnt, sizeof(cnt));
+    xorMemory(&e, (unsigned char*)&cnt, sizeof(ULONGLONG));
   }
 #else
   {
     DWORD cnt = osGetTickCount();
-    xorMemory(&e, (unsigned char*)&cnt, sizeof(cnt));
+    xorMemory(&e, (unsigned char*)&cnt, sizeof(DWORD));
   }
-#endif
+#endif /* SQLITE_OS_WINRT */
   {
     LARGE_INTEGER i;
     osQueryPerformanceCounter(&i);
-    xorMemory(&e, (unsigned char*)&i, sizeof(i));
+    xorMemory(&e, (unsigned char*)&i, sizeof(LARGE_INTEGER));
   }
 #if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID
   {
@@ -5466,7 +5466,7 @@ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
     osUuidCreateSequential(&id);
     xorMemory(&e, (unsigned char*)&id, sizeof(UUID));
   }
-#endif
+#endif /* !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID */
   return e.nXor>nBuf ? nBuf : e.nXor;
 #endif /* defined(SQLITE_TEST) || defined(SQLITE_OMIT_RANDOMNESS) */
 }