1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
>From 23754a769da3da18484ffec7401e21b7cecc7d2d Mon Sep 17 00:00:00 2001
From: Bernhard R. Link <brlink@debian.org>
Date: Sat, 19 Feb 2011 10:42:32 +0100
Subject: avoid some warnings
---
src/callbacks.c | 14 ++++++--------
src/main.c | 9 +++++----
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/src/callbacks.c b/src/callbacks.c
index 3571e5d..d2f7058 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -92,7 +92,7 @@ void revalidate_utf8(gchar *str)
{
extern int debug_on;
gchar *end_valid;
- if ( ! g_utf8_validate (str, -1, &end_valid ) ) {
+ if ( ! g_utf8_validate (str, -1, (const gchar **)&end_valid ) ) {
gsize bytes_read, bytes_written; GError *error=NULL;
if (debug_on) printf(" Non UTF8 string '%s' at char '%c' ",str, *end_valid );
gchar * new = g_locale_to_utf8(str, -1, &bytes_read, &bytes_written, &error );
@@ -743,10 +743,10 @@ void send_print(GtkWidget * button, gpointer ppd)
command_line = g_strdup("a2ps -1 -o - ");
extern GtkWidget *border_toggle;
extern GtkWidget *header_toggle;
- if (!gtk_toggle_button_get_active (header_toggle))
+ if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(header_toggle)))
command_line =
g_strconcat(command_line," -B ",NULL);
- if (!gtk_toggle_button_get_active (border_toggle))
+ if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(border_toggle)))
command_line =
g_strconcat(command_line," --borders=no ",NULL);
command_line =
@@ -948,7 +948,6 @@ void clean_up(GtkWidget * button, gpointer ppd)
-------------------------------------------------------------------*/
GtkWidget *add_notebook_tab (GtkWidget *widget, char *tab_title) {
GtkWidget *label;
- GtkWidget *notebook;
GtkWidget *vbox;
GtkWidget *scroll;
@@ -985,7 +984,6 @@ GtkWidget *add_notebook_tab (GtkWidget *widget, char *tab_title) {
-------------------------------------------------------------------*/
void remove_extra_notebook_tabs (GtkWidget *widget) {
int tidx = 0;
- GtkWidget *notebook;
/* Find our notebook page. */
/* Find our notebook page. */
@@ -1698,7 +1696,7 @@ void retrieve_sett(GtkWidget * menuitem, gpointer ppd)
*/
void update_num_copies(GtkSpinButton * spinbutton, gpointer ppd)
{
- gchar *num_copies; /* number of copies */
+ const gchar *num_copies; /* number of copies */
gchar *copy_command; /* the copy command for ppdfilt */
ppd_struct *local_ppd;
@@ -1791,7 +1789,7 @@ void update_pageset_even(GtkWidget * radiobutton, gpointer ppd)
*/
void update_range_from(GtkWidget * entrybox, gpointer ppd)
{
- gchar *from; /* text of from box */
+ const gchar *from; /* text of from box */
gchar *range; /* range text */
ppd_struct *local_ppd;
@@ -1834,7 +1832,7 @@ void update_range_from(GtkWidget * entrybox, gpointer ppd)
*/
void update_range_to(GtkWidget * entrybox, gpointer ppd)
{
- gchar *to; /* text of to entrybox */
+ const gchar *to; /* text of to entrybox */
gchar *range; /* range text */
ppd_struct *local_ppd;
diff --git a/src/main.c b/src/main.c
index 1ff2b9b..5fce3ea 100644
--- a/src/main.c
+++ b/src/main.c
@@ -50,12 +50,13 @@
#include <gettext.h>
#include <sys/stat.h>
+#include "callbacks.h"
#include "interface.h"
#include "support.h"
#include "tab_categories.h"
/* popt variables and structs */
-static char *printer = NULL;
+static const char *printer = NULL;
static char *jobname = NULL;
static int remove_job = FALSE;
int debug_on = FALSE;
@@ -176,7 +177,7 @@ const struct poptOption options[] = {
#if HAVE_POPT_H
{
poptContext pctx; /* the popt context */
- pctx= poptGetContext("gpr",argc,argv,
+ pctx= poptGetContext("gpr",argc,(const char**)argv,
options, //const struct poptOption * options,
0);//int flags);
@@ -184,8 +185,8 @@ const struct poptOption options[] = {
while( (val= poptGetNextOpt(pctx)) >=0)
printf("%d ",val);
if(val < -1 ) {
- char * msg1=poptBadOption(pctx, POPT_BADOPTION_NOALIAS);
- char * msg2=poptStrerror(val);
+ const char * msg1=poptBadOption(pctx, POPT_BADOPTION_NOALIAS);
+ const char * msg2=poptStrerror(val);
fprintf(stderr,"%s: %s\n",msg1,msg2) ;
//g_error(_("error %d parsing command line parameters"),val) ;
return 1;}
--
1.7.2.3
|