[前][次][番号順一覧][スレッド一覧]

ruby-changes:72754

From: git <ko1@a...>
Date: Sat, 30 Jul 2022 16:41:40 +0900 (JST)
Subject: [ruby-changes:72754] 8a65cf3b61 (master): * expand tabs. [ci skip]

https://git.ruby-lang.org/ruby.git/commit/?id=8a65cf3b61

From 8a65cf3b61c60e4cb886f59a73ff6db44364bfa9 Mon Sep 17 00:00:00 2001
From: git <svn-admin@r...>
Date: Sat, 30 Jul 2022 16:41:32 +0900
Subject: * expand tabs. [ci skip]

Tabs were expanded because the file did not have any tab indentation in unedited lines.
Please update your editor config, and use misc/expand_tabs.rb in the pre-commit hook.
---
 ext/digest/md5/md5.c       |  124 ++--
 ext/digest/md5/md5.h       |    4 +-
 ext/digest/rmd160/rmd160.c |  512 ++++++++---------
 ext/digest/rmd160/rmd160.h |    8 +-
 ext/digest/sha1/sha1.c     |   26 +-
 ext/digest/sha1/sha1.h     |    6 +-
 ext/digest/sha2/sha2.c     | 1374 ++++++++++++++++++++++----------------------
 ext/digest/sha2/sha2.h     |   12 +-
 8 files changed, 1033 insertions(+), 1033 deletions(-)

diff --git a/ext/digest/md5/md5.c b/ext/digest/md5/md5.c
index 3a7fe2cdad..52a787abdb 100644
--- a/ext/digest/md5/md5.c
+++ b/ext/digest/md5/md5.c
@@ -34,8 +34,8 @@ https://github.com/ruby/ruby/blob/trunk/ext/digest/md5/md5.c#L34
   that follows (in reverse chronological order):
 
   2000-07-03 lpd Patched to eliminate warnings about "constant is
-		unsigned in ANSI C, signed in traditional";
-		made test program self-checking.
+                unsigned in ANSI C, signed in traditional";
+                made test program self-checking.
   1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
   1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5).
   1999-05-03 lpd Original version.
@@ -64,32 +64,32 @@ int https://github.com/ruby/ruby/blob/trunk/ext/digest/md5/md5.c#L64
 main(void)
 {
     static const char *const test[7*2] = {
-	"", "d41d8cd98f00b204e9800998ecf8427e",
-	"a", "0cc175b9c0f1b6a831c399e269772661",
-	"abc", "900150983cd24fb0d6963f7d28e17f72",
-	"message digest", "f96b697d7cb7938d525a2f31aaf161d0",
-	"abcdefghijklmnopqrstuvwxyz", "c3fcd3d76192e4007dfb496cca67e13b",
-	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
-				"d174ab98d277d9f5a5611c2c9f419d9f",
-	"12345678901234567890123456789012345678901234567890123456789012345678901234567890", "57edf4a22be3c955ac49da2e2107b67a"
+        "", "d41d8cd98f00b204e9800998ecf8427e",
+        "a", "0cc175b9c0f1b6a831c399e269772661",
+        "abc", "900150983cd24fb0d6963f7d28e17f72",
+        "message digest", "f96b697d7cb7938d525a2f31aaf161d0",
+        "abcdefghijklmnopqrstuvwxyz", "c3fcd3d76192e4007dfb496cca67e13b",
+        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
+                                "d174ab98d277d9f5a5611c2c9f419d9f",
+        "12345678901234567890123456789012345678901234567890123456789012345678901234567890", "57edf4a22be3c955ac49da2e2107b67a"
     };
     int i;
 
     for (i = 0; i < 7*2; i += 2) {
-	MD5_CTX state;
-	uint8_t digest[16];
-	char hex_output[16*2 + 1];
-	int di;
-
-	MD5_Init(&state);
-	MD5_Update(&state, (const uint8_t *)test[i], strlen(test[i]));
-	MD5_Final(digest, &state);
-	printf("MD5 (\"%s\") = ", test[i]);
-	for (di = 0; di < 16; ++di)
-	    sprintf(hex_output + di * 2, "%02x", digest[di]);
-	puts(hex_output);
-	if (strcmp(hex_output, test[i + 1]))
-	    printf("**** ERROR, should be: %s\n", test[i + 1]);
+        MD5_CTX state;
+        uint8_t digest[16];
+        char hex_output[16*2 + 1];
+        int di;
+
+        MD5_Init(&state);
+        MD5_Update(&state, (const uint8_t *)test[i], strlen(test[i]));
+        MD5_Final(digest, &state);
+        printf("MD5 (\"%s\") = ", test[i]);
+        for (di = 0; di < 16; ++di)
+            sprintf(hex_output + di * 2, "%02x", digest[di]);
+        puts(hex_output);
+        if (strcmp(hex_output, test[i + 1]))
+            printf("**** ERROR, should be: %s\n", test[i + 1]);
     }
     return 0;
 }
@@ -106,18 +106,18 @@ main(void) https://github.com/ruby/ruby/blob/trunk/ext/digest/md5/md5.c#L106
 {
     int i;
     for (i = 1; i <= 64; ++i) {
-	unsigned long v = (unsigned long)(4294967296.0 * fabs(sin((double)i)));
-
-	/*
-	 * The following nonsense is only to avoid compiler warnings about
-	 * "integer constant is unsigned in ANSI C, signed with -traditional".
-	 */
-	if (v >> 31) {
-	    printf("#define T%d /* 0x%08lx */ (T_MASK ^ 0x%08lx)\n", i,
-		   v, (unsigned long)(unsigned int)(~v));
-	} else {
-	    printf("#define T%d    0x%08lx\n", i, v);
-	}
+        unsigned long v = (unsigned long)(4294967296.0 * fabs(sin((double)i)));
+
+        /*
+         * The following nonsense is only to avoid compiler warnings about
+         * "integer constant is unsigned in ANSI C, signed with -traditional".
+         */
+        if (v >> 31) {
+            printf("#define T%d /* 0x%08lx */ (T_MASK ^ 0x%08lx)\n", i,
+                   v, (unsigned long)(unsigned int)(~v));
+        } else {
+            printf("#define T%d    0x%08lx\n", i, v);
+        }
     }
     return 0;
 }
@@ -199,8 +199,8 @@ static void https://github.com/ruby/ruby/blob/trunk/ext/digest/md5/md5.c#L199
 md5_process(MD5_CTX *pms, const uint8_t *data /*[64]*/)
 {
     uint32_t
-	a = pms->state[0], b = pms->state[1],
-	c = pms->state[2], d = pms->state[3];
+        a = pms->state[0], b = pms->state[1],
+        c = pms->state[2], d = pms->state[3];
     uint32_t t;
 
 #ifdef WORDS_BIGENDIAN
@@ -214,7 +214,7 @@ md5_process(MD5_CTX *pms, const uint8_t *data /*[64]*/) https://github.com/ruby/ruby/blob/trunk/ext/digest/md5/md5.c#L214
     int i;
 
     for (i = 0; i < 16; ++i, xp += 4)
-	X[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24);
+        X[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24);
 
 #else
 
@@ -226,12 +226,12 @@ md5_process(MD5_CTX *pms, const uint8_t *data /*[64]*/) https://github.com/ruby/ruby/blob/trunk/ext/digest/md5/md5.c#L226
     const uint32_t *X;
 
     if (!(((uintptr_t)data) & 3)) {
-	/* data are properly aligned */
-	X = (const uint32_t *)data;
+        /* data are properly aligned */
+        X = (const uint32_t *)data;
     } else {
-	/* not aligned */
-	memcpy(xbuf, data, 64);
-	X = xbuf;
+        /* not aligned */
+        memcpy(xbuf, data, 64);
+        X = xbuf;
     }
 #endif
 
@@ -370,55 +370,55 @@ MD5_Update(MD5_CTX *pms, const uint8_t *data, size_t nbytes) https://github.com/ruby/ruby/blob/trunk/ext/digest/md5/md5.c#L370
     uint32_t nbits = (uint32_t)(nbytes << 3);
 
     if (nbytes == 0)
-	return;
+        return;
 
     /* Update the message length. */
     pms->count[1] += nbytes >> 29;
     pms->count[0] += nbits;
     if (pms->count[0] < nbits)
-	pms->count[1]++;
+        pms->count[1]++;
 
     /* Process an initial partial block. */
     if (offset) {
-	size_t copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
-
-	memcpy(pms->buffer + offset, p, copy);
-	if (offset + copy < 64)
-	    return;
-	p += copy;
-	left -= copy;
-	md5_process(pms, pms->buffer);
+        size_t copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
+
+        memcpy(pms->buffer + offset, p, copy);
+        if (offset + copy < 64)
+            return;
+        p += copy;
+        left -= copy;
+        md5_process(pms, pms->buffer);
     }
 
     /* Process full blocks. */
     for (; left >= 64; p += 64, left -= 64)
-	md5_process(pms, p);
+        md5_process(pms, p);
 
     /* Process a final partial block. */
     if (left)
-	memcpy(pms->buffer, p, left);
+        memcpy(pms->buffer, p, left);
 }
 
 int
 MD5_Finish(MD5_CTX *pms, uint8_t *digest)
 {
     static const uint8_t pad[64] = {
-	0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+        0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
     };
     uint8_t data[8];
     size_t i;
 
     /* Save the length before padding. */
     for (i = 0; i < 8; ++i)
-	data[i] = (uint8_t)(pms->count[i >> 2] >> ((i & 3) << 3));
+        data[i] = (uint8_t)(pms->count[i >> 2] >> ((i & 3) << 3));
     /* Pad to 56 bytes mod 64. */
     MD5_Update(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
     /* Append the length. */
     MD5_Update(pms, data, 8);
     for (i = 0; i < 16; ++i)
-	digest[i] = (uint8_t)(pms->state[i >> 2] >> ((i & 3) << 3));
+        digest[i] = (uint8_t)(pms->state[i >> 2] >> ((i & 3) << 3));
     return 1;
 }
diff --git a/ext/digest/md5/md5.h b/ext/digest/md5/md5.h
index 1b3383c5ee..0b04f9fc4e 100644
--- a/ext/digest/md5/md5.h
+++ b/ext/digest/md5/md5.h
@@ -34,8 +34,8 @@ https://github.com/ruby/ruby/blob/trunk/ext/digest/md5/md5.h#L34
 
   1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
   1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
-	added conditionalization for C++ compilation from Martin
-	Purschke <purschke@b...>.
+        added conditionalization for C++ compilation from Martin
+        Purschke <purschke@b...>.
   1999-05-03 lpd Original version.
  */
 
diff --git a/ext/digest/rmd160/rmd160.c b/ext/digest/rmd160/rmd160.c
index 058d004f3a..0ea78dcd64 100644
--- a/ext/digest/rmd160/rmd160.c
+++ b/ext/digest/rmd160/rmd160.c
@@ -128,17 +128,17 @@ int https://github.com/ruby/ruby/blob/trunk/ext/digest/rmd160/rmd160.c#L128
 RMD160_Init(RMD160_CTX *context)
 {
 
-	_DIAGASSERT(context != NULL);
-
-	/* ripemd-160 initialization constants */
-	context->state[0] = 0x67452301U;
-	context->state[1] = 0xefcdab89U;
-	context->state[2] = 0x98badcfeU;
-	context->state[3] = 0x10325476U;
-	context->state[4] = 0xc3d2e1f0U;
-	context->length[0] = context->length[1] = 0;
-	context->buflen = 0;
-	return 1;
+        _DIAGASSERT(context != NULL);
+
+        /* ripemd-160 initialization constants */
+        context->state[0] = 0x67452301U;
+        context->state[1] = 0xefcdab89U;
+        context->state[2] = 0x98badcfeU;
+        context->state[3] = 0x10325476U;
+        context->state[4] = 0xc3d2e1f0U;
+        (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]