소스 검색

Fixed warning C4706: assignment within conditional expression

Sam Lantinga 1 년 전
부모
커밋
74e85e3a51
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      test/testautomation_pen.c
  2. 2 2
      test/testime.c

+ 1 - 1
test/testautomation_pen.c

@@ -1342,7 +1342,7 @@ pen_movementAndAxes(void *arg)
 
     _pen_simulate_init(&ptest, simulated_pens, 2);
     /* Simulate pen movements */
-    while ((last_action = _pen_simulate(steps, &sim_pc, &simulated_pens[0], 2))) {
+    while ((last_action = _pen_simulate(steps, &sim_pc, &simulated_pens[0], 2)) != 0) {
         int attempts = 0;
         SDL_Pen *simpen = &simulated_pens[last_action->pen_index];
         SDL_PenID reported_which = 0;

+ 2 - 2
test/testime.c

@@ -501,7 +501,7 @@ static void _Redraw(int rendererID)
         drawnTextRect.y = dstrect.y;
         drawnTextRect.h = dstrect.h;
 
-        while ((codepoint = utf8_decode(utext, len = utf8_length(*utext)))) {
+        while ((codepoint = utf8_decode(utext, len = utf8_length(*utext))) != 0) {
             Sint32 advance = unifont_draw_glyph(codepoint, rendererID, &dstrect) * UNIFONT_DRAW_SCALE;
             dstrect.x += advance;
             drawnTextRect.w += advance;
@@ -573,7 +573,7 @@ static void _Redraw(int rendererID)
         drawnTextRect.y = dstrect.y;
         drawnTextRect.h = dstrect.h;
 
-        while ((codepoint = utf8_decode(utext, len = utf8_length(*utext)))) {
+        while ((codepoint = utf8_decode(utext, len = utf8_length(*utext))) != 0) {
             Sint32 advance = unifont_draw_glyph(codepoint, rendererID, &dstrect) * UNIFONT_DRAW_SCALE;
             dstrect.x += advance;
             drawnTextRect.w += advance;