Permalink
Browse files

Fixes for -Wall

git-svn-id: https://svn.r-project.org/R/branches/R-1-4-patches@20418 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
1 parent 7eb0d8f commit 0ed312c65bd4ebe40d4876def3f9e620961bfaf6 martyn committed Jul 10, 2002
@@ -27,6 +27,7 @@
#include "devGNOME.h"
#include "terminal.h"
#include "device-support.h"
+#include "terminal-functions.h"
#define CURSOR GDK_CROSSHAIR /* Default cursor */
#define MM_PER_INCH 25.4 /* mm -> inch conversion */
@@ -45,7 +45,7 @@ R_gtk_terminal_line_event (GtkWidget * widget)
/* Fill a text buffer with user typed console input. */
int
-Rgnome_ReadConsole (char *prompt, unsigned char *buf, int len,
+Rgnome_ReadConsole (char *prompt, char *buf, int len,
int addtohistory)
{
if (!R_Interactive)
@@ -246,6 +246,8 @@ void pager_set_style()
*/
}
+#define BUFSIZE 2048
+
int Rgnome_ShowFiles(int nfile, char **file, char **title, char *wtitle,
Rboolean del, char *pager)
{
@@ -257,8 +259,7 @@ int Rgnome_ShowFiles(int nfile, char **file, char **title, char *wtitle,
GdkFont *titlefont, *emfont;
GdkColor textcolor, bgcolor;
- const gint bufsize = 2048;
- gchar buf[bufsize];
+ gchar buf[BUFSIZE];
gint i;
gint fd, readlen;
gchar *j, *k;
@@ -317,7 +318,7 @@ int Rgnome_ShowFiles(int nfile, char **file, char **title, char *wtitle,
for(i = 0; i < nfile; i++) {
if((title[i] != NULL) && (*title[i] != '\0')) {
- g_snprintf(buf, bufsize, "%s\n\n", title[i]);
+ g_snprintf(buf, BUFSIZE, "%s\n\n", title[i]);
gtk_text_insert(GTK_TEXT(pager_data->text),
titlefont,
&textcolor,
@@ -326,7 +327,7 @@ int Rgnome_ShowFiles(int nfile, char **file, char **title, char *wtitle,
}
if((fd = open(file[i], O_RDONLY, "")) != -1) {
do {
- readlen = read(fd, buf, bufsize);
+ readlen = read(fd, buf, BUFSIZE);
emmode = FALSE;
modestart = buf;
@@ -360,10 +361,10 @@ int Rgnome_ShowFiles(int nfile, char **file, char **title, char *wtitle,
gtk_text_insert(GTK_TEXT(pager_data->text), NULL, NULL, NULL,
modestart, k - modestart);
- } while(readlen == bufsize);
+ } while(readlen == BUFSIZE);
}
else {
- g_snprintf(buf, bufsize, "NO FILE %s\n\n", file[i]);
+ g_snprintf(buf, BUFSIZE, "NO FILE %s\n\n", file[i]);
gtk_text_insert(GTK_TEXT(pager_data->text), NULL, NULL, NULL,
buf, strlen(buf));
}
@@ -220,7 +220,8 @@ static void help_about_cb(GtkWidget *widget,
hbox = gtk_hbox_new(TRUE, 0);
home_href = gnome_href_new("http://www.r-project.org/", "R home page");
- FAQ_href = gnome_href_new("http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html", "R FAQ");
+ FAQ_href = gnome_href_new("http://cran.r-project.org/doc/FAQ/R-FAQ.html",
+ "R FAQ");
gtk_box_pack_start(GTK_BOX(hbox), home_href, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), FAQ_href, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(about_box)->vbox),

0 comments on commit 0ed312c

Please sign in to comment.