]> andersk Git - moira.git/blobdiff - server/qvalidate.pc
second code style cleanup: void/void * usage, proper #includes. try to
[moira.git] / server / qvalidate.pc
index fa25f891bd29018260c1811db9082dbd8c1064ef..a70a73800a791859c282ef0274942d515b5f5673 100644 (file)
@@ -1,27 +1,26 @@
-/*
- *     $Source$
- *     $Author$
- *     $Header$
+/* $Id$
  *
- *     Copyright (C) 1987 by the Massachusetts Institute of Technology
- *     For copying and distribution information, please see the file
- *     <mit-copyright.h>.
+ * Argument validation routines
  *
+ * Copyright (C) 1987-1998 by the Massachusetts Institute of Technology
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
  */
 
-#ifndef lint
-static char *rcsid_qsupport_dc = "$Header$";
-#endif lint
-
 #include <mit-copyright.h>
-#include <unistd.h>
 #include "mr_server.h"
 #include "query.h"
+#include "qrtn.h"
+
 #include <ctype.h>
+#include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
+
 EXEC SQL INCLUDE sqlca;
 EXEC SQL INCLUDE sqlda;
-#include "qrtn.h"
+
+RCSID("$Header$");
 
 extern char *whoami, *table_name[], *sqlbuffer[QMAXARGS];
 extern int dbms_errno, mr_errcode;
@@ -42,6 +41,7 @@ int readlock_table(struct valobj *vo);
 int convert_wildcards_uppercase(char *arg);
 
 extern SQLDA *sqlald(int, int, int);
+SQLDA *mr_alloc_sqlda(void);
 
 EXEC SQL WHENEVER SQLERROR DO dbmserr();
 
@@ -200,7 +200,6 @@ static int illegalchars[] = {
 int validate_chars(char *argv[], struct valobj *vo)
 {
   char *s = argv[vo->index];
-  int arg;
   EXEC SQL BEGIN DECLARE SECTION;
   int len;
   char *tname, *cname;
@@ -209,7 +208,7 @@ int validate_chars(char *argv[], struct valobj *vo)
   /* check for bad characters */
   while (*s)
     {
-      if (illegalchars[*s++])
+      if (illegalchars[(int)*s++])
        return MR_BAD_CHAR;
     }
 
@@ -373,7 +372,7 @@ int validate_type(char *argv[], struct valobj *vo)
   c = val = argv[vo->index];
   while (*c)
     {
-      if (illegalchars[*c++])
+      if (illegalchars[(int)*c++])
        return MR_BAD_CHAR;
     }
 
@@ -586,7 +585,7 @@ void sanity_check_database(void)
 char *sqlbuffer[QMAXARGS];
 
 /* Dynamic SQL support routines */
-SQLDA *mr_alloc_sqlda()
+SQLDA *mr_alloc_sqlda(void)
 {
   SQLDA *it;
   int j;
@@ -698,7 +697,7 @@ int convert_wildcards_uppercase(char *arg)
 int add_string(char *nm)
 {
   EXEC SQL BEGIN DECLARE SECTION;
-  char buf[256], *name = nm;
+  char *name = nm;
   int id;
   EXEC SQL END DECLARE SECTION;
 
@@ -706,7 +705,7 @@ int add_string(char *nm)
   id++;
   EXEC SQL UPDATE numvalues SET value = :id WHERE name = 'strings_id';
 
-  EXEC SQL INSERT INTO strings (string_id, string) VALUES (:id, :nm);
+  EXEC SQL INSERT INTO strings (string_id, string) VALUES (:id, :name);
 
   return id;
 }
This page took 0.115146 seconds and 4 git commands to generate.