File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ OBJS=libut.a
22all : $(OBJS )
33INCDIR =../include
44CFLAGS =-I$(INCDIR )
5- CFLAGS+ =-Wall
5+ CFLAGS+ =-Wall -Wextra
66CFLAGS+ =-g
77
88libut.a : libut.o utvector.o
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ PROGS=test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 test11 test12
22 test13 test14 test15
33OBJS =$(patsubst % ,% .o,$(PROGS ) )
44
5- CFLAGS = -I../include -L../src
5+ CFLAGS = -I../include
66CFLAGS += -g
7- CFLAGS += -Wall
8- LDFLAGS =-lut
7+ CFLAGS += -Wall -Wextra
8+ LDFLAGS =-lut -L../src
99
1010TEST_TARGET =run_tests
1111TESTS =./do_tests
Original file line number Diff line number Diff line change @@ -164,15 +164,15 @@ _UNUSED_ static void _utstring_BuildTable(
164164 i = 0 ;
165165 j = i - 1 ;
166166 P_KMP_Table [i ] = j ;
167- while (i < P_NeedleLen )
167+ while (i < ( long ) P_NeedleLen )
168168 {
169169 while ( (j > -1 ) && (P_Needle [i ] != P_Needle [j ]) )
170170 {
171171 j = P_KMP_Table [j ];
172172 }
173173 i ++ ;
174174 j ++ ;
175- if (i < P_NeedleLen )
175+ if (i < ( long ) P_NeedleLen )
176176 {
177177 if (P_Needle [i ] == P_Needle [j ])
178178 {
@@ -206,7 +206,7 @@ _UNUSED_ static void _utstring_BuildTableR(
206206 P_KMP_Table [i + 1 ] = j ;
207207 while (i >= 0 )
208208 {
209- while ( (j < P_NeedleLen ) && (P_Needle [i ] != P_Needle [j ]) )
209+ while ( (j < ( long ) P_NeedleLen ) && (P_Needle [i ] != P_Needle [j ]) )
210210 {
211211 j = P_KMP_Table [j + 1 ];
212212 }
@@ -321,7 +321,7 @@ _UNUSED_ static long utstring_find(
321321 V_StartPosition = P_StartPosition ;
322322 }
323323 V_HaystackLen = s -> i - V_StartPosition ;
324- if ( (V_HaystackLen >= P_NeedleLen ) && (P_NeedleLen > 0 ) )
324+ if ( (V_HaystackLen >= ( long ) P_NeedleLen ) && (P_NeedleLen > 0 ) )
325325 {
326326 V_KMP_Table = (long * )malloc (sizeof (long ) * (P_NeedleLen + 1 ));
327327 if (V_KMP_Table != NULL )
@@ -367,7 +367,7 @@ _UNUSED_ static long utstring_findR(
367367 V_StartPosition = P_StartPosition ;
368368 }
369369 V_HaystackLen = V_StartPosition + 1 ;
370- if ( (V_HaystackLen >= P_NeedleLen ) && (P_NeedleLen > 0 ) )
370+ if ( (V_HaystackLen >= ( long ) P_NeedleLen ) && (P_NeedleLen > 0 ) )
371371 {
372372 V_KMP_Table = (long * )malloc (sizeof (long ) * (P_NeedleLen + 1 ));
373373 if (V_KMP_Table != NULL )
You can’t perform that action at this time.
0 commit comments