eddelbuettel / digest

R package to create compact hash digests of R objects
https://eddelbuettel.github.io/digest
111 stars 47 forks source link

signedness warnings addressed #217

Closed pearsonca closed 2 months ago

pearsonca commented 2 months ago

Should address #216

eddelbuettel commented 2 months ago

Lovely. Can you toss a ChangeLog entry in to close the deal?

eddelbuettel commented 2 months ago

There is also a bit of remaining nagging on 'unused':

ccache gcc -I"/usr/share/R/include" -DNDEBUG -I.      -fpic  -g -O2 -Wall -pipe -DBOOST_NO_AUTO_PTR -Wno-sign-compare -Wno-parentheses -Wno-maybe-uninitialized   -std=gnu99 -c digest.c -o digest.o
digest.c: In function ‘digest’:                                                                          
digest.c:250:50: warning: unused variable ‘d’ [-Wunused-variable]                          
  250 |         unsigned char sha512sum[output_length], *d = sha512sum;                                  
      |                                                  ^                                               
digest.c:422:44: warning: unused variable ‘d’ [-Wunused-variable]                                        
  422 |         uint8_t sha512sum[output_length], *d = sha512sum;                                        
      |                                            ^                                                     
digest.c:168:26: warning: unused variable ‘outputp’ [-Wunused-variable]
  168 |     char output[128+1], *outputp = output;    /* 33 for md5, 41 for sha1, 65 for sha256, 128 for sha512; plus trailing NULL */
      |                          ^~~~~~~                                                                 
digest.c: At top level:                                                                                  
digest.c:51:20: warning: ‘sha2_hex_digits’ defined but not used [-Wunused-variable]
   51 | static const char *sha2_hex_digits = "0123456789abcdef";                                         
      |                    ^~~~~~~~~~~~~~~                                                               
ccache gcc -I"/usr/share/R/include" -DNDEBUG -I.      -fpic  -g -O2 -Wall -pipe -DBOOST_NO_AUTO_PTR -Wno-sign-compare -Wno-parentheses -Wno-maybe-uninitialized   -std=gnu99 -c digest2int.c -o digest2int.o

But 'signedness' is nailed, so thank you!

pearsonca commented 2 months ago

Didn't see those unused, sorry - just landed from Transatlantic flight or would have hopped on this earlier.

pearsonca commented 2 months ago

I think the sha const needs to go into the define block for USESHA512, but I can take care of that. The others were definitely vestigial.

eddelbuettel commented 2 months ago

Done in a970e58.

Amended to fd1fa9f.