summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2008-04-29 21:37:57 +0200
committerAlbert Astals Cid <aacid@kde.org>2008-04-29 21:37:57 +0200
commitee57ead8a6f34fa8de044399e5912395e0f3a425 (patch)
treeaacabdd50ab0bb62cc8be0e01c747c5869dbcdc8 /utils
parent9f93d9eb464877e0d23dcf205295da9162f03253 (diff)
constify argDesc arrays
Gives me binaries 2KB smaller (in total) in release build
Diffstat (limited to 'utils')
-rw-r--r--utils/parseargs.c18
-rw-r--r--utils/parseargs.h4
-rw-r--r--utils/pdffonts.cc2
-rw-r--r--utils/pdfimages.cc2
-rw-r--r--utils/pdfinfo.cc2
-rw-r--r--utils/pdftoabw.cc2
-rw-r--r--utils/pdftohtml.cc2
-rw-r--r--utils/pdftoppm.cc2
-rw-r--r--utils/pdftops.cc2
-rw-r--r--utils/pdftotext.cc2
10 files changed, 19 insertions, 19 deletions
diff --git a/utils/parseargs.c b/utils/parseargs.c
index 9f579436..465c2cbe 100644
--- a/utils/parseargs.c
+++ b/utils/parseargs.c
@@ -13,11 +13,11 @@
#include <ctype.h>
#include "parseargs.h"
-static ArgDesc *findArg(ArgDesc *args, char *arg);
-static GBool grabArg(ArgDesc *arg, int i, int *argc, char *argv[]);
+static const ArgDesc *findArg(const ArgDesc *args, char *arg);
+static GBool grabArg(const ArgDesc *arg, int i, int *argc, char *argv[]);
-GBool parseArgs(ArgDesc *args, int *argc, char *argv[]) {
- ArgDesc *arg;
+GBool parseArgs(const ArgDesc *args, int *argc, char *argv[]) {
+ const ArgDesc *arg;
int i, j;
GBool ok;
@@ -39,8 +39,8 @@ GBool parseArgs(ArgDesc *args, int *argc, char *argv[]) {
return ok;
}
-void printUsage(char *program, char *otherArgs, ArgDesc *args) {
- ArgDesc *arg;
+void printUsage(char *program, char *otherArgs, const ArgDesc *args) {
+ const ArgDesc *arg;
char *typ;
int w, w1;
@@ -84,8 +84,8 @@ void printUsage(char *program, char *otherArgs, ArgDesc *args) {
}
}
-static ArgDesc *findArg(ArgDesc *args, char *arg) {
- ArgDesc *p;
+static const ArgDesc *findArg(const ArgDesc *args, char *arg) {
+ const ArgDesc *p;
for (p = args; p->arg; ++p) {
if (p->kind < argFlagDummy && !strcmp(p->arg, arg))
@@ -94,7 +94,7 @@ static ArgDesc *findArg(ArgDesc *args, char *arg) {
return NULL;
}
-static GBool grabArg(ArgDesc *arg, int i, int *argc, char *argv[]) {
+static GBool grabArg(const ArgDesc *arg, int i, int *argc, char *argv[]) {
int n;
int j;
GBool ok;
diff --git a/utils/parseargs.h b/utils/parseargs.h
index 1b1c570e..983a4251 100644
--- a/utils/parseargs.h
+++ b/utils/parseargs.h
@@ -51,12 +51,12 @@ typedef struct {
* descriptor list <args>. Stops parsing if "--" is found (and removes
* it). Returns gFalse if there was an error.
*/
-extern GBool parseArgs(ArgDesc *args, int *argc, char *argv[]);
+extern GBool parseArgs(const ArgDesc *args, int *argc, char *argv[]);
/*
* Print usage message, based on arg descriptor list.
*/
-extern void printUsage(char *program, char *otherArgs, ArgDesc *args);
+extern void printUsage(char *program, char *otherArgs, const ArgDesc *args);
/*
* Check if a string is a valid integer or floating point number.
diff --git a/utils/pdffonts.cc b/utils/pdffonts.cc
index 8be75312..7691d7eb 100644
--- a/utils/pdffonts.cc
+++ b/utils/pdffonts.cc
@@ -49,7 +49,7 @@ static char userPassword[33] = "\001";
static GBool printVersion = gFalse;
static GBool printHelp = gFalse;
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
{"-f", argInt, &firstPage, 0,
"first page to examine"},
{"-l", argInt, &lastPage, 0,
diff --git a/utils/pdfimages.cc b/utils/pdfimages.cc
index 3f42218a..febbdea6 100644
--- a/utils/pdfimages.cc
+++ b/utils/pdfimages.cc
@@ -38,7 +38,7 @@ static GBool quiet = gFalse;
static GBool printVersion = gFalse;
static GBool printHelp = gFalse;
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
{"-f", argInt, &firstPage, 0,
"first page to convert"},
{"-l", argInt, &lastPage, 0,
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc
index 5dbd7247..b9fc10e6 100644
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@ -46,7 +46,7 @@ static char userPassword[33] = "\001";
static GBool printVersion = gFalse;
static GBool printHelp = gFalse;
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
{"-f", argInt, &firstPage, 0,
"first page to convert"},
{"-l", argInt, &lastPage, 0,
diff --git a/utils/pdftoabw.cc b/utils/pdftoabw.cc
index 1de338d5..ebbf2716 100644
--- a/utils/pdftoabw.cc
+++ b/utils/pdftoabw.cc
@@ -44,7 +44,7 @@ static char userPassword[33] = "";
// static char textEncName[128] = "";
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
{"-f", argInt, &firstPage, 0,
"first page to convert"},
{"-l", argInt, &lastPage, 0,
diff --git a/utils/pdftohtml.cc b/utils/pdftohtml.cc
index 1ebd7af9..2604db7c 100644
--- a/utils/pdftohtml.cc
+++ b/utils/pdftohtml.cc
@@ -65,7 +65,7 @@ static GooString* getInfoDate(Dict *infoDict, char *key);
static char textEncName[128] = "";
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
{"-f", argInt, &firstPage, 0,
"first page to convert"},
{"-l", argInt, &lastPage, 0,
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index 164679de..4a4006d8 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -42,7 +42,7 @@ static GBool quiet = gFalse;
static GBool printVersion = gFalse;
static GBool printHelp = gFalse;
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
{"-f", argInt, &firstPage, 0,
"first page to print"},
{"-l", argInt, &lastPage, 0,
diff --git a/utils/pdftops.cc b/utils/pdftops.cc
index 8f60ea3e..e3f426c0 100644
--- a/utils/pdftops.cc
+++ b/utils/pdftops.cc
@@ -83,7 +83,7 @@ static GBool quiet = gFalse;
static GBool printVersion = gFalse;
static GBool printHelp = gFalse;
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
{"-f", argInt, &firstPage, 0,
"first page to print"},
{"-l", argInt, &lastPage, 0,
diff --git a/utils/pdftotext.cc b/utils/pdftotext.cc
index a0caed8d..10707e51 100644
--- a/utils/pdftotext.cc
+++ b/utils/pdftotext.cc
@@ -49,7 +49,7 @@ static GBool quiet = gFalse;
static GBool printVersion = gFalse;
static GBool printHelp = gFalse;
-static ArgDesc argDesc[] = {
+static const ArgDesc argDesc[] = {
{"-f", argInt, &firstPage, 0,
"first page to convert"},
{"-l", argInt, &lastPage, 0,