[MPlayer-dev-eng] [PATCH] remove warning from unrarlib code

adland adland123 at yahoo.com
Thu Apr 1 01:17:01 CEST 2004


Here is a warning during compile of CVS code.

unrarlib.c: In function `SetCryptKeys':
unrarlib.c:2514: warning: comparison is always true due to limited
 range of data type

patch to fix.

diff -Naur main/unrarlib.c updated/unrarlib.c
--- main/unrarlib.c     2003-10-05 06:35:10.000000000 -0400
+++ updated/unrarlib.c  2004-03-31 18:05:28.000000000 -0500
@@ -2511,9 +2511,9 @@
     {
       N2=(unsigned char)CRCTab[(Psw[I+1]+J)&0xFF];
       for (K=1, N1=(unsigned char)CRCTab[(Psw[I]-J)&0xFF];
-           (N1!=N2) && (N1 < 256);      /* I had to add "&& (N1 < 256)",    */
-           N1++, K++)                   /* because the system crashed with  */
-          {                             /* encrypted RARs                   */
+           (N1!=N2);   /* N1 is always under 256 due to char datatype  :)  */
+           N1++, K++)
+          {
 #ifdef _USE_ASM

 #ifdef _WIN_32



Thanks




More information about the MPlayer-dev-eng mailing list