FLTK logo

[master] dc13b56 - Fix compiler warnings (Windows only)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] dc13b56 - Fix compiler warnings (Windows only) "Albrecht Schlosser" Aug 30, 2021  
 
commit dc13b569150359005a9bf343aef56eeda12094a1
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Mon Aug 30 14:16:49 2021 +0200
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Mon Aug 30 14:16:49 2021 +0200

    Fix compiler warnings (Windows only)
    
    src/Fl_Native_File_Chooser_WIN32.cxx:331:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
      331 |   while ( s=strchr(s,'\\') ) *s = '/';
          |           ~^~~~~~~~~~~~~~~
    
    src/Fl_Native_File_Chooser_WIN32.cxx:336:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
      336 |   while ( s=strchr(s,'/') ) *s = '\\';
          |           ~^~~~~~~~~~~~~~

 src/Fl_Native_File_Chooser_WIN32.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git src/Fl_Native_File_Chooser_WIN32.cxx src/Fl_Native_File_Chooser_WIN32.cxx
index 1046e92..71d98f0 100644
--- src/Fl_Native_File_Chooser_WIN32.cxx
+++ src/Fl_Native_File_Chooser_WIN32.cxx
@@ -328,12 +328,12 @@ void Fl_WinAPI_Native_File_Chooser_Driver::ClearBINF() {
 
 // CONVERT WINDOWS BACKSLASHES TO UNIX FRONTSLASHES
 void Fl_WinAPI_Native_File_Chooser_Driver::Win2Unix(char *s) {
-  while ( s=strchr(s,'\\') ) *s = '/';
+  while ( (s=strchr(s,'\\')) ) *s = '/';
 }
 
 // CONVERT UNIX FRONTSLASHES TO WINDOWS BACKSLASHES
 void Fl_WinAPI_Native_File_Chooser_Driver::Unix2Win(char *s) {
-  while ( s=strchr(s,'/') ) *s = '\\';
+  while ( (s=strchr(s,'/')) ) *s = '\\';
 }
 
 // SEE IF PATH IS FRONT SLASH OR BACKSLASH STYLE
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.