1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-24 09:25:01 +00:00
freebsd-ports/editors/yui/files/patch-tyui_yui1.cc
Jan Beich f0e50ca4a6 editors/yui: partially unbreak with clang 4.0
main.cc:1153:36: error: ordered comparison between pointer and zero ('char *' and 'int')
  while( fgets( buf1024, 1023, f ) > 0 ) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
main.cc:1768:39: error: ordered comparison between pointer and zero ('char *' and 'int')
            while( fgets( buf1024, 1023, f ) > 0 ) {
                   ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
main.cc:1865:35: error: ordered comparison between pointer and zero ('char *' and 'int')
        while( fgets( buf1024, 1023, f ) > 0 ) {
               ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
main.cc:1948:35: error: ordered comparison between pointer and zero ('char *' and 'int')
        while( fgets( buf1024, 1023, f ) > 0 ) {
               ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
main.cc:2030:39: error: ordered comparison between pointer and zero ('char *' and 'int')
            while( fgets( buf1024, 1023, f ) > 0 ) {
                   ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
main.cc:2147:39: error: ordered comparison between pointer and zero ('char *' and 'int')
            while( fgets( buf1024, 1023, f ) > 0 ) {
                   ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
main.cc:2483:37: error: ordered comparison between pointer and zero ('char *' and 'int')
     if ( fgets( buf1024, 1023, f ) <= 0 )
          ~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~
main.cc:2618:32: error: ordered comparison between pointer and zero ('char *' and 'int')
  while( fgets( buf, 1023, f ) > 0 )
         ~~~~~~~~~~~~~~~~~~~~~ ^ ~
yui1.cc:2668:19: error: ordered comparison between pointer and zero ('FILE *' (aka '__sFILE *') and
      'int')
       if ( forig <= 0 ) {
            ~~~~~ ^  ~
yui1.cc:2678:15: error: ordered comparison between pointer and zero ('FILE *' (aka '__sFILE *') and
      'int')
           if ( fbak <= 0 ) {
                ~~~~ ^  ~
yui1.cc:2787:15: error: ordered comparison between pointer and zero ('FILE *' (aka '__sFILE *') and
      'int')
   if ( forig <= 0 ) {
        ~~~~~ ^  ~

Reported by:	antoine (via exp-run)
2017-02-01 05:29:06 +00:00

30 lines
1.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--- tyui/yui1.cc.orig 2011-09-29 11:50:50 UTC
+++ tyui/yui1.cc
@@ -2665,7 +2665,7 @@ int Edit::saveText( char *Name )
Screen::sync();
if ( strlen(name) > 0 && BAK_FILE(eOpt.options) ) {
FILE *forig = fopen( name, "r" );
- if ( forig <= 0 ) {
+ if ( forig == NULL ) {
modal *m = new modal( ALIGN_CENTER,
lang( "Can't open original file,\ncreation of backup file skipped",
"ïÛÉÂËÁ ÏÔËÒÙÔÉÑ ÉÓÈÏÄÎÏÇÏ ÆÁÊÌÁ,\nÓÏÚÄÁÎÉÅ '.bak'-ÆÁÊÌÁ ÐÒÏÐÕÝÅÎÏ" ), Warning.get() );
@@ -2675,7 +2675,7 @@ int Edit::saveText( char *Name )
char *nameBack = strdup( Buf1 );
fd = open( nameBack, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR );
FILE *fbak = (fd >= 0 ? fdopen( fd, "w+" ) : 0);
- if ( fbak <= 0 ) {
+ if ( fbak == NULL ) {
sprintf( Buf1, openError.get(), nameBack );
modal *m = new modal( ALIGN_CENTER, (char*)Buf1, Warning.get() );
execUp( m );
@@ -2784,7 +2784,7 @@ write_char:
unlink( realName );
fd = open( realName, O_RDWR | O_CREAT | O_TRUNC, fInfo->s.st_mode );
FILE *forig = (fd >= 0 ? fdopen( fd, "w+" ) : 0);
- if ( forig <= 0 ) {
+ if ( forig == NULL ) {
fclose( f );
sprintf( Buf1, lang("Can't open file\n%s\n\nCheck permissions, your file saved in\n%s",
"ïÛÉÂËÁ ÏÔËÒÙÔÉÑ ÆÁÊÌÁ\n%s\n\nðÒÏ×ÅÒØÔÅ ÐÒÁ×Á ÄÏÓÔÕÐÁ, ÆÁÊÌ ÓÏÈÒÁÎÅÎ ×\n%s"), name, tmp );