diff options
author | jbeich <jbeich@FreeBSD.org> | 2017-02-01 13:29:06 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2017-02-01 13:29:06 +0800 |
commit | f269049aa47b49f4723393a15ea4a461af48eb7e (patch) | |
tree | f635d28f1703ab062db0a2a8b1eefc575586c40c /editors | |
parent | b0fc5629d37a27ee53ab4958bd10ad9afae3eb19 (diff) | |
download | freebsd-ports-gnome-f269049aa47b49f4723393a15ea4a461af48eb7e.tar.gz freebsd-ports-gnome-f269049aa47b49f4723393a15ea4a461af48eb7e.tar.zst freebsd-ports-gnome-f269049aa47b49f4723393a15ea4a461af48eb7e.zip |
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)
Diffstat (limited to 'editors')
-rw-r--r-- | editors/yui/files/patch-tyui_main.cc | 74 | ||||
-rw-r--r-- | editors/yui/files/patch-tyui_yui1.cc | 29 |
2 files changed, 103 insertions, 0 deletions
diff --git a/editors/yui/files/patch-tyui_main.cc b/editors/yui/files/patch-tyui_main.cc new file mode 100644 index 000000000000..1d590571c768 --- /dev/null +++ b/editors/yui/files/patch-tyui_main.cc @@ -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 ) diff --git a/editors/yui/files/patch-tyui_yui1.cc b/editors/yui/files/patch-tyui_yui1.cc new file mode 100644 index 000000000000..86257df03d86 --- /dev/null +++ b/editors/yui/files/patch-tyui_yui1.cc @@ -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 ); |