[Pinfo-devel] r158 - pinfo/branches/cxx/src
Nathanael Nerode
neroden-guest at costa.debian.org
Sat Sep 3 21:47:03 UTC 2005
Author: neroden-guest
Date: 2005-09-03 21:47:02 +0000 (Sat, 03 Sep 2005)
New Revision: 158
Modified:
pinfo/branches/cxx/src/mainfunction.cxx
pinfo/branches/cxx/src/manual.cxx
pinfo/branches/cxx/src/signal_handler.cxx
pinfo/branches/cxx/src/video.cxx
pinfo/branches/cxx/src/video.h
Log:
Fix warnings (and a few stupid signed/unsigned bugs).
Modified: pinfo/branches/cxx/src/mainfunction.cxx
===================================================================
--- pinfo/branches/cxx/src/mainfunction.cxx 2005-09-03 21:01:14 UTC (rev 157)
+++ pinfo/branches/cxx/src/mainfunction.cxx 2005-09-03 21:47:02 UTC (rev 158)
@@ -46,7 +46,7 @@
long pos, infomenu;
long infocolumn=0;
-typeof(hyperobjects.size()) cursor;
+int cursor;
@@ -179,7 +179,7 @@
if (key == ERR)
{
if (statusline == FREE)
- showscreen(Message, Type, Lines, pos, cursor,infocolumn);
+ showscreen(Message, Lines, pos, cursor,infocolumn);
waitforgetch();
key = pinfo_getch();
}
@@ -1160,7 +1160,8 @@
{
if ((mouse.y > 0) &&(mouse.y < maxy - 1))
{
- for (typeof(hyperobjects.size()) i = cursor; i >= 0; i--)
+ /* signed/unsigned. Use iterators. FIXME. */
+ for (int i = cursor; i >= 0; i--)
{
if (hyperobjects[i].line == mouse.y + pos - 1)
{
@@ -1267,7 +1268,8 @@
int fileoffset = 0;
if (!indirect.empty())
{
- for (typeof(indirect.size()) i = indirect.size() - 1; i >= 0; i--)
+ /* signed/unsigned. Use iterators. FIXME */
+ for (int i = indirect.size() - 1; i >= 0; i--)
{
if (indirect[i].offset <= tag_table[tag_table_pos].offset)
{
Modified: pinfo/branches/cxx/src/manual.cxx
===================================================================
--- pinfo/branches/cxx/src/manual.cxx 2005-09-03 21:01:14 UTC (rev 157)
+++ pinfo/branches/cxx/src/manual.cxx 2005-09-03 21:47:02 UTC (rev 158)
@@ -381,12 +381,12 @@
system(cmd_string.c_str());
stat(tmpfilename2.c_str(), &statbuf);
if (statbuf.st_size > 0) {
- string cmd_string = "mv ";
- cmd_string += tmpfilename2;
- cmd_string += " ";
- cmd_string += tmpfilename1;
+ string cmd_string2 = "mv ";
+ cmd_string2 += tmpfilename2;
+ cmd_string2 += " ";
+ cmd_string2 += tmpfilename1;
/* create tmp file containing man page */
- system(cmd_string.c_str());
+ system(cmd_string2.c_str());
/* open man page */
id = fopen(tmpfilename1.c_str(), "r");
if (id != NULL) {
@@ -720,7 +720,7 @@
/* key, which contains the value entered by user */
int key = 0;
/* tmp values */
- int i, selectedchanged;
+ int selectedchanged;
int statusline = FREE;
#ifdef getmaxyx
/* if ncurses, get maxx and maxy */
@@ -842,7 +842,7 @@
if (token)
{
int digit_val = 1;
- for (i = 0; token[i] != 0; i++)
+ for (int i = 0; token[i] != 0; i++)
{
if (!isdigit(token[i]))
digit_val = 0;
@@ -892,7 +892,7 @@
if (pipe != NULL)
{
/* and flush the msg to stdin */
- for (i = 0; i < ManualLines; i++)
+ for (int i = 0; i < ManualLines; i++)
fprintf(pipe, "%s", manual[i]);
pclose(pipe);
}
@@ -966,7 +966,7 @@
goto skip_search;
}
/* and search for it in all subsequential lines */
- for (i = manualpos + 1; i < ManualLines - 1; i++)
+ for (int i = manualpos + 1; i < ManualLines - 1; i++)
{
string tmpstr;
/*
@@ -1044,7 +1044,7 @@
* scan for a next visible one, which is above the
* current.
*/
- for (i = selected - 1; i >= 0; i--)
+ for (int i = selected - 1; i >= 0; i--)
{
if ((manuallinks[i].line >= manualpos) &&
(manuallinks[i].line < manualpos +(maxy - 1)))
@@ -1085,7 +1085,7 @@
if ((key == keys.nextnode_1) ||
(key == keys.nextnode_2))
{
- for (i = manualpos + 1; i < ManualLines; i++)
+ for (int i = manualpos + 1; i < ManualLines; i++)
{
if (manual[i][1] == 8)
{
@@ -1098,7 +1098,7 @@
if ((key == keys.prevnode_1) ||
(key == keys.prevnode_2))
{
- for (i = manualpos - 1; i > 0; i--)
+ for (int i = manualpos - 1; i > 0; i--)
{
if (manual[i][1] == 8)
{
@@ -1261,7 +1261,7 @@
{
if ((mouse.y > 0) &&(mouse.y < maxy - 1))
{
- for (i = selected; i >= 0; i--)
+ for (int i = selected; i >= 0; i--)
{
if (manuallinks[i].line == mouse.y + manualpos - 1)
{
@@ -1277,7 +1277,7 @@
}
}
if (!done)
- for (i = selected; i < manuallinks.size(); i++)
+ for (int i = selected; i < manuallinks.size(); i++)
{
if (manuallinks[i].line == mouse.y + manualpos - 1)
{
@@ -1302,7 +1302,7 @@
{
if ((mouse.y > 0) &&(mouse.y < maxy - 1))
{
- for (i = selected; i >= 0; i--)
+ for (int i = selected; i >= 0; i--)
{
if (manuallinks[i].line == mouse.y + manualpos - 1)
{
@@ -1318,7 +1318,7 @@
}
}
if (!done)
- for (i = selected; i < manuallinks.size(); i++)
+ for (int i = selected; i < manuallinks.size(); i++)
{
if (manuallinks[i].line == mouse.y + manualpos - 1)
{
@@ -1392,14 +1392,13 @@
void
showmanualscreen()
{
- int i;
#ifdef getmaxyx
/* refresh maxy, maxx values */
getmaxyx(stdscr, maxy, maxx);
#endif
attrset(normal);
/* print all visible text lines */
- for (i = manualpos;(i < manualpos +(maxy - 2)) &&(i < ManualLines); i++)
+ for (int i = manualpos;(i < manualpos +(maxy - 2)) &&(i < ManualLines); i++)
{
int len = strlen(manual[i]);
if (len)
Modified: pinfo/branches/cxx/src/signal_handler.cxx
===================================================================
--- pinfo/branches/cxx/src/signal_handler.cxx 2005-09-03 21:01:14 UTC (rev 157)
+++ pinfo/branches/cxx/src/signal_handler.cxx 2005-09-03 21:47:02 UTC (rev 158)
@@ -38,7 +38,7 @@
}
void
-handle_window_resize(int signum)
+handle_window_resize(int signum __attribute__((unused)) )
{
winchanged = 1;
ungetch(keys.refresh_1);
Modified: pinfo/branches/cxx/src/video.cxx
===================================================================
--- pinfo/branches/cxx/src/video.cxx 2005-09-03 21:01:14 UTC (rev 157)
+++ pinfo/branches/cxx/src/video.cxx 2005-09-03 21:47:02 UTC (rev 158)
@@ -68,7 +68,7 @@
}
void
-showscreen(char **message, char *type, long lines, long pos, long cursor, int column)
+showscreen(char **message, long lines, long pos, long cursor, int column)
{
long i;
#ifdef getmaxyx
Modified: pinfo/branches/cxx/src/video.h
===================================================================
--- pinfo/branches/cxx/src/video.h 2005-09-03 21:01:14 UTC (rev 157)
+++ pinfo/branches/cxx/src/video.h 2005-09-03 21:47:02 UTC (rev 158)
@@ -25,7 +25,7 @@
#define __VIDEO_H
#include <string>
/* paints the screen while viewing info file */
-void showscreen (char **message, char *type, long lines, long pos,
+void showscreen (char **message, long lines, long pos,
long cursor, int column);
/* prints unselected menu option */
void mvaddstr_menu (int y, int x, char *line, int linenumber);
More information about the Pinfo-devel
mailing list