Date: Wed, 1 Feb 2017 05:29:06 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r432986 - head/editors/yui/files Message-ID: <201702010529.v115T65l088927@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Wed Feb 1 05:29:06 2017 New Revision: 432986 URL: https://svnweb.freebsd.org/changeset/ports/432986 Log: 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) Added: head/editors/yui/files/patch-tyui_main.cc (contents, props changed) head/editors/yui/files/patch-tyui_yui1.cc (contents, props changed) Added: head/editors/yui/files/patch-tyui_main.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/editors/yui/files/patch-tyui_main.cc Wed Feb 1 05:29:06 2017 (r432986) @@ -0,0 +1,74 @@ +--- tyui/main.cc.orig 2011-09-29 06:55:56 UTC ++++ tyui/main.cc +@@ -1150,7 +1150,7 @@ void Appl::findCtag( char *ctag ) + int line=0; + Edit *e = NULL; + +- while( fgets( buf1024, 1023, f ) > 0 ) { ++ while( fgets( buf1024, 1023, f ) ) { + buf1024[1023] = 0; + if ( buf1024[0] == 0x1b || !(s=strtok( buf1024, "\t" )) || strcmp( ctag, s ) ) + continue; +@@ -1765,7 +1765,7 @@ void Appl::readOptions() + char *s = NULL; + OPT_info *cinfo = NULL; + next: +- while( fgets( buf1024, 1023, f ) > 0 ) { ++ while( fgets( buf1024, 1023, f ) ) { + buf1024[1023] = 0; + s=strtok( buf1024, " \t\r\n" ); + for( int first=1; s; s=strtok( 0, " \t\r\n" ) ) { +@@ -1862,7 +1862,7 @@ void Appl::readColormap() + for( int i=0; i < len_color_info; i++ ) + color_info[i].inited = 0; + next: +- while( fgets( buf1024, 1023, f ) > 0 ) { ++ while( fgets( buf1024, 1023, f ) ) { + buf1024[1023] = 0; + s=strtok( buf1024, " \t\r\n" ); + for( int first=1; s; s=strtok( 0, " \t\r\n" ) ) { +@@ -1945,7 +1945,7 @@ void Appl::readColortrans() + char *fg=NULL, *bg=NULL, *s=NULL; + int found_term=0, c_fg=0, c_bg=0; + next: +- while( fgets( buf1024, 1023, f ) > 0 ) { ++ while( fgets( buf1024, 1023, f ) ) { + if ( fg && bg ) + break; + buf1024[1023] = 0; +@@ -2027,7 +2027,7 @@ void Appl::readKeymap() + for( int i=0; i < len_com_info; i++ ) + com_info[i].inited = 0; + next: +- while( fgets( buf1024, 1023, f ) > 0 ) { ++ while( fgets( buf1024, 1023, f ) ) { + COM_info *cinfo = NULL; + buf1024[1023] = 0; + s=strtok( buf1024, " \t\r\n" ); +@@ -2144,7 +2144,7 @@ void Appl::readMacro() + } + if ( f ) { + next: +- while( fgets( buf1024, 1023, f ) > 0 ) { ++ while( fgets( buf1024, 1023, f ) ) { + + + } +@@ -2480,7 +2480,7 @@ void parse_highlight( const char *home ) + int punctuate = 1; + tinfo.name = buf2; + for( int cycle=1; cycle; ) { +- if ( fgets( buf1024, 1023, f ) <= 0 ) ++ if ( fgets( buf1024, 1023, f ) == NULL ) + { + cycle=0; + if ( ext ) +@@ -2615,7 +2615,7 @@ void parse_highlight_html( const char *h + unsigned param=0, hend=0, ret=0; + tinfo.name = buf2; + int ext_flag = 1; +- while( fgets( buf, 1023, f ) > 0 ) ++ while( fgets( buf, 1023, f ) ) + { + buf[1023] = 0; + if ( sscanf( buf, "%[^# \t]%u%u", buf2, ¶m, &hend ) != 3 ) Added: head/editors/yui/files/patch-tyui_yui1.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/editors/yui/files/patch-tyui_yui1.cc Wed Feb 1 05:29:06 2017 (r432986) @@ -0,0 +1,29 @@ +--- 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 );
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702010529.v115T65l088927>