Issue #26798: for loop initial declarations are only allowed in C99 o… · pythoncapi/cpython@87bf0fe · GitHub
Skip to content

Commit 87bf0fe

Browse files
committed
Issue python#26798: for loop initial declarations are only allowed in C99 or C11 mode
1 parent 90493ab commit 87bf0fe

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

Modules/_blake2/impl/blake2b-ref.c

Lines changed: 4 additions & 2 deletions

Modules/_blake2/impl/blake2b.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,10 @@ BLAKE2_LOCAL_INLINE(int) blake2b_param_set_personal( blake2b_param *P, const uin
174174

175175
BLAKE2_LOCAL_INLINE(int) blake2b_init0( blake2b_state *S )
176176
{
177+
int i;
177178
memset( S, 0, sizeof( blake2b_state ) );
178179

179-
for( int i = 0; i < 8; ++i ) S->h[i] = blake2b_IV[i];
180+
for( i = 0; i < 8; ++i ) S->h[i] = blake2b_IV[i];
180181

181182
return 0;
182183
}
@@ -188,10 +189,11 @@ int blake2b_init_param( blake2b_state *S, const blake2b_param *P )
188189
const uint8_t * v = ( const uint8_t * )( blake2b_IV );
189190
const uint8_t * p = ( const uint8_t * )( P );
190191
uint8_t * h = ( uint8_t * )( S->h );
192+
int i;
191193
/* IV XOR ParamBlock */
192194
memset( S, 0, sizeof( blake2b_state ) );
193195

194-
for( int i = 0; i < BLAKE2B_OUTBYTES; ++i ) h[i] = v[i] ^ p[i];
196+
for( i = 0; i < BLAKE2B_OUTBYTES; ++i ) h[i] = v[i] ^ p[i];
195197

196198
return 0;
197199
}

Modules/_blake2/impl/blake2s-ref.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,10 @@ BLAKE2_LOCAL_INLINE(int) blake2s_param_set_personal( blake2s_param *P, const uin
138138

139139
BLAKE2_LOCAL_INLINE(int) blake2s_init0( blake2s_state *S )
140140
{
141+
int i;
141142
memset( S, 0, sizeof( blake2s_state ) );
142143

143-
for( int i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i];
144+
for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i];
144145

145146
return 0;
146147
}
@@ -308,6 +309,7 @@ int blake2s_update( blake2s_state *S, const uint8_t *in, uint64_t inlen )
308309
int blake2s_final( blake2s_state *S, uint8_t *out, uint8_t outlen )
309310
{
310311
uint8_t buffer[BLAKE2S_OUTBYTES] = {0};
312+
int i;
311313

312314
if( out == NULL || outlen == 0 || outlen > BLAKE2S_OUTBYTES )
313315
return -1;
@@ -329,7 +331,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, uint8_t outlen )
329331
memset( S->buf + S->buflen, 0, 2 * BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */
330332
blake2s_compress( S, S->buf );
331333

332-
for( int i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
334+
for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
333335
store32( buffer + sizeof( S->h[i] ) * i, S->h[i] );
334336

335337
memcpy( out, buffer, outlen );

Modules/_blake2/impl/blake2s.c

Lines changed: 6 additions & 3 deletions

0 commit comments

Comments
 (0)