[Pinfo-devel] r163 - pinfo/trunk/src
Bas Zoetekouw
bas at costa.debian.org
Sun Sep 4 00:39:52 UTC 2005
Author: bas
Date: 2005-09-04 00:39:51 +0000 (Sun, 04 Sep 2005)
New Revision: 163
Modified:
pinfo/trunk/src/common_includes.h
pinfo/trunk/src/filehandling_functions.c
pinfo/trunk/src/mainfunction.c
pinfo/trunk/src/manual.c
pinfo/trunk/src/parse_config.c
pinfo/trunk/src/signal_handler.c
pinfo/trunk/src/utils.h
Log:
Fixed -Wall warnings
Modified: pinfo/trunk/src/common_includes.h
===================================================================
--- pinfo/trunk/src/common_includes.h 2005-09-04 00:18:13 UTC (rev 162)
+++ pinfo/trunk/src/common_includes.h 2005-09-04 00:39:51 UTC (rev 163)
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
+#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <pwd.h>
Modified: pinfo/trunk/src/filehandling_functions.c
===================================================================
--- pinfo/trunk/src/filehandling_functions.c 2005-09-04 00:18:13 UTC (rev 162)
+++ pinfo/trunk/src/filehandling_functions.c 2005-09-04 00:39:51 UTC (rev 163)
@@ -908,7 +908,7 @@
/* split at ':' and put the path components into paths[] */
c = infopath;
- while (dir = strsep(&c, ":"))
+ while ( (dir = strsep(&c, ":")) != NULL )
{
/* if this actually is a non-empty string, add it to paths[] */
if ( dir && strlen(dir)>0 )
@@ -1200,7 +1200,7 @@
int j;
for (j = 0; j < SuffixesNumber; j++)
{
- if (found = strstr(file, suffixes[j].suffix))
+ if ( (found = strstr(file, suffixes[j].suffix)) != NULL )
{
if (*(found + strlen(suffixes[j].suffix)) == 0)
{
Modified: pinfo/trunk/src/mainfunction.c
===================================================================
--- pinfo/trunk/src/mainfunction.c 2005-09-04 00:18:13 UTC (rev 162)
+++ pinfo/trunk/src/mainfunction.c 2005-09-04 00:39:51 UTC (rev 163)
@@ -994,9 +994,10 @@
if (!toggled_by_menu)
infohistory.menu[infohistory.length] = cursor;
if ((cursor >= 0) &&(cursor < hyperobjectcount))
- if ((hyperobjects[cursor].line >= pos) &&
- (hyperobjects[cursor].line < pos +(maxy - 2)) ||
- (toggled_by_menu))
+ if (
+ ( (hyperobjects[cursor].line >= pos)
+ && (hyperobjects[cursor].line < pos +(maxy - 2) )
+ ) || (toggled_by_menu) )
{
toggled_by_menu = 0;
if (hyperobjects[cursor].type < 4) /* normal info link */
Modified: pinfo/trunk/src/manual.c
===================================================================
--- pinfo/trunk/src/manual.c 2005-09-04 00:18:13 UTC (rev 162)
+++ pinfo/trunk/src/manual.c 2005-09-04 00:39:51 UTC (rev 163)
@@ -247,19 +247,12 @@
{
int return_value = 0;
struct stat statbuf;
- FILE *id, *source;
+ FILE *id;
- char **ignored_entries;
char manualname[256];
char cmd[256];
- char location[256];
- char line[1025];
char *raw_tempfilename = 0;
char *apropos_tempfilename = 0;
- char *end, *prev;
- size_t macroline_size;
- int ignored_items = 0, i = 0;
- char zipped = 0;
if (tmpfilename1)
{
@@ -296,6 +289,15 @@
* There is a stored variable raw_tempfilename to allow unlinking this temp *
* file after usage *
****************************************************************************/
+ FILE *source;
+ char **ignored_entries;
+ char location[256];
+ char line[1025];
+ char *end, *prev;
+ size_t macroline_size;
+ int ignored_items = 0, i = 0;
+ char zipped = 0;
+
/* if the pointer is non-null */
if (ignoredmacros)
/* if there are some macros */
Modified: pinfo/trunk/src/parse_config.c
===================================================================
--- pinfo/trunk/src/parse_config.c 2005-09-04 00:18:13 UTC (rev 162)
+++ pinfo/trunk/src/parse_config.c 2005-09-04 00:39:51 UTC (rev 163)
@@ -117,10 +117,12 @@
else
{
if (rcfile == NULL)
+ {
if (getenv("HOME"))
home = strdup(getenv("HOME"));
else
home = 0;
+ }
if (home)
{
strcpy(config_file_name, home);
Modified: pinfo/trunk/src/signal_handler.c
===================================================================
--- pinfo/trunk/src/signal_handler.c 2005-09-04 00:18:13 UTC (rev 162)
+++ pinfo/trunk/src/signal_handler.c 2005-09-04 00:39:51 UTC (rev 163)
@@ -46,6 +46,8 @@
void
signal_handler()
{
+ sigset_t sigs;
+
signal(SIGINT, handle_crash); /* handle ^C */
signal(SIGTERM, handle_crash); /* handle soft kill */
signal(SIGSEGV, handle_crash); /* handle seg. fault */
@@ -53,5 +55,8 @@
#ifdef SIGWINCH
signal(SIGWINCH, handle_window_resize);
#endif
- sigblock(sigmask(SIGPIPE)); /* block broken pipe signal */
+ /* block broken pipe signal */
+ sigemptyset(&sigs);
+ sigaddset(&sigs, SIGPIPE);
+ sigprocmask(SIG_BLOCK, &sigs, NULL);
}
Modified: pinfo/trunk/src/utils.h
===================================================================
--- pinfo/trunk/src/utils.h 2005-09-04 00:18:13 UTC (rev 162)
+++ pinfo/trunk/src/utils.h 2005-09-04 00:39:51 UTC (rev 163)
@@ -61,6 +61,8 @@
void myclrtoeol ();
/* takes care of the cursor, which is turned off */
void myendwin ();
+/* ? */
+void handlewinch ();
/* get offset of "node" in tag_table variable */
int gettagtablepos (char *node);
More information about the Pinfo-devel
mailing list