mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	blake2: silence two more warnings on platforms with size_t < uint64_t. Don't use SSE2 when cross-compiling
This commit is contained in:
		
							parent
							
								
									680cb152c5
								
							
						
					
					
						commit
						dfb9ef1357
					
				
					 3 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -307,8 +307,8 @@ int blake2b_update( blake2b_state *S, const uint8_t *in, uint64_t inlen )
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else /* inlen <= fill */
 | 
					    else /* inlen <= fill */
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      memcpy( S->buf + left, in, inlen );
 | 
					      memcpy( S->buf + left, in, (size_t)inlen );
 | 
				
			||||||
      S->buflen += inlen; /* Be lazy, do not compress */
 | 
					      S->buflen += (size_t)inlen; /* Be lazy, do not compress */
 | 
				
			||||||
      in += inlen;
 | 
					      in += inlen;
 | 
				
			||||||
      inlen -= inlen;
 | 
					      inlen -= inlen;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -298,8 +298,8 @@ int blake2s_update( blake2s_state *S, const uint8_t *in, uint64_t inlen )
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else /* inlen <= fill */
 | 
					    else /* inlen <= fill */
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      memcpy( S->buf + left, in, inlen );
 | 
					      memcpy( S->buf + left, in, (size_t)inlen );
 | 
				
			||||||
      S->buflen += inlen; /* Be lazy, do not compress */
 | 
					      S->buflen += (size_t)inlen; /* Be lazy, do not compress */
 | 
				
			||||||
      in += inlen;
 | 
					      in += inlen;
 | 
				
			||||||
      inlen -= inlen;
 | 
					      inlen -= inlen;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								setup.py
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								setup.py
									
										
									
									
									
								
							| 
						 | 
					@ -894,7 +894,7 @@ def detect_modules(self):
 | 
				
			||||||
        blake2_deps.append('hashlib.h')
 | 
					        blake2_deps.append('hashlib.h')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        blake2_macros = []
 | 
					        blake2_macros = []
 | 
				
			||||||
        if os.uname().machine == "x86_64":
 | 
					        if not cross_compiling and os.uname().machine == "x86_64":
 | 
				
			||||||
            # Every x86_64 machine has at least SSE2.
 | 
					            # Every x86_64 machine has at least SSE2.
 | 
				
			||||||
            blake2_macros.append(('BLAKE2_USE_SSE', '1'))
 | 
					            blake2_macros.append(('BLAKE2_USE_SSE', '1'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue