diff options
| author | Ken Raeburn <raeburn@mit.edu> | 2001-10-10 03:18:22 +0000 |
|---|---|---|
| committer | Ken Raeburn <raeburn@mit.edu> | 2001-10-10 03:18:22 +0000 |
| commit | 7613acc70e37ebabd7743da02da4f4ff0d218d5c (patch) | |
| tree | ea7b08ad73cfb7cd8a5ca8e77a9fb646770804f0 /src/util | |
| parent | ad4d9f8d0f83524931da62aebb592ab53f2218d9 (diff) | |
| download | krb5-7613acc70e37ebabd7743da02da4f4ff0d218d5c.tar.gz krb5-7613acc70e37ebabd7743da02da4f4ff0d218d5c.tar.xz krb5-7613acc70e37ebabd7743da02da4f4ff0d218d5c.zip | |
Don't conditionalize prototypes; delete macros supporting it. (Maybe overdone;
don't worry about restoring them when importing new versions of code.)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13792 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/dyn/ChangeLog | 5 | ||||
| -rw-r--r-- | src/util/dyn/dyn.h | 37 | ||||
| -rw-r--r-- | src/util/dyn/dynP.h | 11 | ||||
| -rw-r--r-- | src/util/profile/ChangeLog | 5 | ||||
| -rw-r--r-- | src/util/profile/prof_int.h | 88 | ||||
| -rw-r--r-- | src/util/profile/profile.hin | 62 | ||||
| -rw-r--r-- | src/util/profile/test_parse.c | 2 | ||||
| -rw-r--r-- | src/util/ss/ChangeLog | 6 | ||||
| -rw-r--r-- | src/util/ss/mk_cmds.c | 2 | ||||
| -rw-r--r-- | src/util/ss/ss_internal.h | 30 |
10 files changed, 112 insertions, 136 deletions
diff --git a/src/util/dyn/ChangeLog b/src/util/dyn/ChangeLog index f6f22c9f7..1ced11574 100644 --- a/src/util/dyn/ChangeLog +++ b/src/util/dyn/ChangeLog @@ -1,3 +1,8 @@ +2001-10-09 Ken Raeburn <raeburn@mit.edu> + + * dyn.h, dynP.h: Make prototypes unconditional. Don't define + P(). + 2001-04-25 Ezra Peisach <epeisach@mit.edu> * test.c: Always include stdlib.h diff --git a/src/util/dyn/dyn.h b/src/util/dyn/dyn.h index 267d758dd..86cd0b205 100644 --- a/src/util/dyn/dyn.h +++ b/src/util/dyn/dyn.h @@ -36,28 +36,21 @@ typedef struct _DynObject { #define DYN_BADINDEX -1002 #define DYN_BADVALUE -1003 -/* Function declarations */ -#if defined(__STDC__) || defined(__LCLINT__) -#define P(args) args -#else -#define P(args) () -#endif /* __STDC__ */ - -/*@null@*//*@only@*/ DynObject DynCreate P((int el_size, int inc)); -/*@null@*//*@only@*/ DynObject DynCopy P((DynObject obj)); -int DynDestroy P((/*@only@*/DynObject obj)), DynRelease P((DynObject obj)); -int DynAdd P((DynObject obj, void *el)); -int DynPut P((DynObject obj, void *el, int idx)); -int DynInsert P((DynObject obj, int idx, /*@observer@*/void *els, int num)); -int DynDelete P((DynObject obj, int idx)); -/*@dependent@*//*@null@*/ DynPtr DynGet P((DynObject obj, int num)); -/*@observer@*/ DynPtr DynArray P((DynObject obj)); -int DynDebug P((DynObject obj, int state)); -int DynParanoid P((DynObject obj, int state)); -int DynInitzero P((DynObject obj, int state)); -int DynSize P((DynObject obj)); -int DynCapacity P((DynObject obj)); -int DynAppend P((DynObject obj, DynPtr els, int num)); +/*@null@*//*@only@*/ DynObject DynCreate (int el_size, int inc); +/*@null@*//*@only@*/ DynObject DynCopy (DynObject obj); +int DynDestroy (/*@only@*/DynObject obj), DynRelease (DynObject obj); +int DynAdd (DynObject obj, void *el); +int DynPut (DynObject obj, void *el, int idx); +int DynInsert (DynObject obj, int idx, /*@observer@*/void *els, int num); +int DynDelete (DynObject obj, int idx); +/*@dependent@*//*@null@*/ DynPtr DynGet (DynObject obj, int num); +/*@observer@*/ DynPtr DynArray (DynObject obj); +int DynDebug (DynObject obj, int state); +int DynParanoid (DynObject obj, int state); +int DynInitzero (DynObject obj, int state); +int DynSize (DynObject obj); +int DynCapacity (DynObject obj); +int DynAppend (DynObject obj, DynPtr els, int num); #undef P diff --git a/src/util/dyn/dynP.h b/src/util/dyn/dynP.h index 6cc6e5867..bd86637bb 100644 --- a/src/util/dyn/dynP.h +++ b/src/util/dyn/dynP.h @@ -37,16 +37,9 @@ typedef struct _DynObject DynObjectRecP, *DynObjectP; -/* Function declarations */ -#ifdef __STDC__ -#define P(args) args -#else -#define P(args) () -#endif /* __STDC__ */ - /* Internal functions */ -int _DynRealloc P((DynObjectP obj, int req)), - _DynResize P((DynObjectP obj, int req)); +int _DynRealloc (DynObjectP obj, int req), + _DynResize (DynObjectP obj, int req); #undef P diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index 25a73a841..8108968f6 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -1,3 +1,8 @@ +2001-10-09 Ken Raeburn <raeburn@mit.edu> + + * prof_int.h, profile.hin, test_parse.c: Make prototypes + unconditional. Don't define PROTOTYPE. + 2001-10-05 Ken Raeburn <raeburn@mit.edu> * profile.hin (KRB5_EXPORTVAR): Don't define. diff --git a/src/util/profile/prof_int.h b/src/util/profile/prof_int.h index 3d24f23c3..3f120a7fa 100644 --- a/src/util/profile/prof_int.h +++ b/src/util/profile/prof_int.h @@ -7,12 +7,6 @@ #include "prof_err.h" #include "profile.h" -#if defined(__STDC__) || defined(_WIN32) -#define PROTOTYPE(x) x -#else -#define PROTOTYPE(x) () -#endif - #if defined(_WIN32) #define SIZEOF_INT 4 #define SIZEOF_SHORT 2 @@ -81,120 +75,120 @@ struct _profile_t { /* profile_parse.c */ errcode_t profile_parse_file - PROTOTYPE((FILE *f, struct profile_node **root)); + (FILE *f, struct profile_node **root); errcode_t profile_write_tree_file - PROTOTYPE((struct profile_node *root, FILE *dstfile)); + (struct profile_node *root, FILE *dstfile); /* prof_tree.c */ void profile_free_node - PROTOTYPE((struct profile_node *relation)); + (struct profile_node *relation); errcode_t profile_create_node - PROTOTYPE((const char *name, const char *value, - struct profile_node **ret_node)); + (const char *name, const char *value, + struct profile_node **ret_node); errcode_t profile_verify_node - PROTOTYPE((struct profile_node *node)); + (struct profile_node *node); errcode_t profile_add_node - PROTOTYPE ((struct profile_node *section, + (struct profile_node *section, const char *name, const char *value, - struct profile_node **ret_node)); + struct profile_node **ret_node); errcode_t profile_make_node_final - PROTOTYPE((struct profile_node *node)); + (struct profile_node *node); int profile_is_node_final - PROTOTYPE((struct profile_node *node)); + (struct profile_node *node); const char *profile_get_node_name - PROTOTYPE((struct profile_node *node)); + (struct profile_node *node); const char *profile_get_node_value - PROTOTYPE((struct profile_node *node)); + (struct profile_node *node); errcode_t profile_find_node - PROTOTYPE ((struct profile_node *section, + (struct profile_node *section, const char *name, const char *value, int section_flag, void **state, - struct profile_node **node)); + struct profile_node **node); errcode_t profile_find_node_relation - PROTOTYPE ((struct profile_node *section, + (struct profile_node *section, const char *name, void **state, - char **ret_name, char **value)); + char **ret_name, char **value); errcode_t profile_find_node_subsection - PROTOTYPE ((struct profile_node *section, + (struct profile_node *section, const char *name, void **state, - char **ret_name, struct profile_node **subsection)); + char **ret_name, struct profile_node **subsection); errcode_t profile_get_node_parent - PROTOTYPE ((struct profile_node *section, - struct profile_node **parent)); + (struct profile_node *section, + struct profile_node **parent); errcode_t profile_delete_node_relation - PROTOTYPE ((struct profile_node *section, const char *name)); + (struct profile_node *section, const char *name); errcode_t profile_find_node_name - PROTOTYPE ((struct profile_node *section, void **state, - char **ret_name)); + (struct profile_node *section, void **state, + char **ret_name); errcode_t profile_node_iterator_create - PROTOTYPE((profile_t profile, const char *const *names, - int flags, void **ret_iter)); + (profile_t profile, const char *const *names, + int flags, void **ret_iter); void profile_node_iterator_free - PROTOTYPE((void **iter_p)); + (void **iter_p); errcode_t profile_node_iterator - PROTOTYPE((void **iter_p, struct profile_node **ret_node, - char **ret_name, char **ret_value)); + (void **iter_p, struct profile_node **ret_node, + char **ret_name, char **ret_value); errcode_t profile_remove_node - PROTOTYPE((struct profile_node *node)); + (struct profile_node *node); errcode_t profile_set_relation_value - PROTOTYPE((struct profile_node *node, const char *new_value)); + (struct profile_node *node, const char *new_value); errcode_t profile_rename_node - PROTOTYPE((struct profile_node *node, const char *new_name)); + (struct profile_node *node, const char *new_name); /* prof_file.c */ errcode_t profile_open_file - PROTOTYPE ((const_profile_filespec_t file, prf_file_t *ret_prof)); + (const_profile_filespec_t file, prf_file_t *ret_prof); errcode_t profile_update_file - PROTOTYPE ((prf_file_t profile)); + (prf_file_t profile); errcode_t profile_flush_file - PROTOTYPE ((prf_file_t profile)); + (prf_file_t profile); void profile_free_file - PROTOTYPE ((prf_file_t profile)); + (prf_file_t profile); errcode_t profile_close_file - PROTOTYPE ((prf_file_t profile)); + (prf_file_t profile); /* prof_init.c -- included from profile.h */ errcode_t profile_ser_size - PROTOTYPE ((const char *, profile_t, size_t *)); + (const char *, profile_t, size_t *); errcode_t profile_ser_externalize - PROTOTYPE ((const char *, profile_t, unsigned char **, size_t *)); + (const char *, profile_t, unsigned char **, size_t *); errcode_t profile_ser_internalize - PROTOTYPE ((const char *, profile_t *, unsigned char **, size_t *)); + (const char *, profile_t *, unsigned char **, size_t *); /* prof_get.c */ errcode_t profile_get_value - PROTOTYPE ((profile_t profile, const char **names, - const char **ret_value)); + (profile_t profile, const char **names, + const char **ret_value); /* Others included from profile.h */ /* prof_set.c -- included from profile.h */ diff --git a/src/util/profile/profile.hin b/src/util/profile/profile.hin index 418696141..2f11524af 100644 --- a/src/util/profile/profile.hin +++ b/src/util/profile/profile.hin @@ -16,14 +16,6 @@ typedef struct _profile_t *profile_t; -#if !defined(PROTOTYPE) -#if defined(__STDC__) || defined(__cplusplus) || defined(_WIN32) -#define PROTOTYPE(x) x -#else -#define PROTOTYPE(x) () -#endif -#endif - /* * Used by the profile iterator in prof_get.c */ @@ -61,72 +53,72 @@ typedef FSSpec* const_profile_filespec_list_t; #endif long KRB5_CALLCONV profile_init - PROTOTYPE ((const_profile_filespec_t *files, profile_t *ret_profile)); + (const_profile_filespec_t *files, profile_t *ret_profile); long KRB5_CALLCONV profile_init_path - PROTOTYPE ((const_profile_filespec_list_t filelist, profile_t *ret_profile)); + (const_profile_filespec_list_t filelist, profile_t *ret_profile); long KRB5_CALLCONV profile_flush - PROTOTYPE ((profile_t profile)); + (profile_t profile); void KRB5_CALLCONV profile_abandon - PROTOTYPE ((profile_t profile)); + (profile_t profile); void KRB5_CALLCONV profile_release - PROTOTYPE ((profile_t profile)); + (profile_t profile); long KRB5_CALLCONV profile_get_values - PROTOTYPE ((profile_t profile, const char *const *names, char ***ret_values)); + (profile_t profile, const char *const *names, char ***ret_values); void KRB5_CALLCONV profile_free_list - PROTOTYPE ((char **list)); + (char **list); long KRB5_CALLCONV profile_get_string - PROTOTYPE((profile_t profile, const char *name, const char *subname, + (profile_t profile, const char *name, const char *subname, const char *subsubname, const char *def_val, - char **ret_string)); + char **ret_string); long KRB5_CALLCONV profile_get_integer - PROTOTYPE((profile_t profile, const char *name, const char *subname, + (profile_t profile, const char *name, const char *subname, const char *subsubname, int def_val, - int *ret_default)); + int *ret_default); long KRB5_CALLCONV profile_get_boolean - PROTOTYPE((profile_t profile, const char *name, const char *subname, + (profile_t profile, const char *name, const char *subname, const char *subsubname, int def_val, - int *ret_default)); + int *ret_default); long KRB5_CALLCONV profile_get_relation_names - PROTOTYPE((profile_t profile, const char **names, char ***ret_names)); + (profile_t profile, const char **names, char ***ret_names); long KRB5_CALLCONV profile_get_subsection_names - PROTOTYPE((profile_t profile, const char **names, char ***ret_names)); + (profile_t profile, const char **names, char ***ret_names); long KRB5_CALLCONV profile_iterator_create - PROTOTYPE((profile_t profile, const char **names, - int flags, void **ret_iter)); + (profile_t profile, const char **names, + int flags, void **ret_iter); void KRB5_CALLCONV profile_iterator_free - PROTOTYPE((void **iter_p)); + (void **iter_p); long KRB5_CALLCONV profile_iterator - PROTOTYPE((void **iter_p, char **ret_name, char **ret_value)); + (void **iter_p, char **ret_name, char **ret_value); -void KRB5_CALLCONV profile_release_string PROTOTYPE((char *str)); +void KRB5_CALLCONV profile_release_string (char *str); long KRB5_CALLCONV profile_update_relation - PROTOTYPE((profile_t profile, const char **names, - const char *old_value, const char *new_value)); + (profile_t profile, const char **names, + const char *old_value, const char *new_value); long KRB5_CALLCONV profile_clear_relation - PROTOTYPE((profile_t profile, const char **names)); + (profile_t profile, const char **names); long KRB5_CALLCONV profile_rename_section - PROTOTYPE((profile_t profile, const char **names, - const char *new_name)); + (profile_t profile, const char **names, + const char *new_name); long KRB5_CALLCONV profile_add_relation - PROTOTYPE((profile_t profile, const char **names, - const char *new_value)); + (profile_t profile, const char **names, + const char *new_value); #ifdef __cplusplus } diff --git a/src/util/profile/test_parse.c b/src/util/profile/test_parse.c index 438675058..7aa0eeb62 100644 --- a/src/util/profile/test_parse.c +++ b/src/util/profile/test_parse.c @@ -8,7 +8,7 @@ #include "prof_int.h" -void dump_profile PROTOTYPE((struct profile_node *root, int level)); +void dump_profile (struct profile_node *root, int level); int main(argc, argv) int argc; diff --git a/src/util/ss/ChangeLog b/src/util/ss/ChangeLog index 4ec085c94..e0668c5cb 100644 --- a/src/util/ss/ChangeLog +++ b/src/util/ss/ChangeLog @@ -1,3 +1,9 @@ +2001-10-09 Ken Raeburn <raeburn@mit.edu> + + * mk_cmds.c, ss_internal.h: Make prototypes unconditional. + * ss_internal.h (PROTOTYPE, const, volatile): Delete. + (pointer): Always use void*. + 2001-09-01 Ken Raeburn <raeburn@mit.edu> * Makefile.in (SRCS): Don't include ss_err.h. diff --git a/src/util/ss/mk_cmds.c b/src/util/ss/mk_cmds.c index bba5edd2f..8e29ccfb3 100644 --- a/src/util/ss/mk_cmds.c +++ b/src/util/ss/mk_cmds.c @@ -19,7 +19,7 @@ static const char copyright[] = "Copyright 1987 by MIT Student Information Processing Board"; -extern pointer malloc PROTOTYPE((unsigned)); +extern pointer malloc (unsigned); extern char *last_token; extern FILE *output_file; diff --git a/src/util/ss/ss_internal.h b/src/util/ss/ss_internal.h index 01a71974b..f8d059d21 100644 --- a/src/util/ss/ss_internal.h +++ b/src/util/ss/ss_internal.h @@ -13,20 +13,8 @@ #include <stdlib.h> #endif -#ifdef __STDC__ - -#define PROTOTYPE(p) p typedef void * pointer; -#else - -#define const -#define volatile -#define PROTOTYPE(p) () -typedef char * pointer; - -#endif /* not __STDC__ */ - #include "ss.h" #if defined(__GNUC__) @@ -36,13 +24,13 @@ typedef char * pointer; #if defined(vax) #define LOCAL_ALLOC(x) alloca(x) #define LOCAL_FREE(x) -extern pointer alloca PROTOTYPE((unsigned)); +extern pointer alloca (unsigned); #else #if defined(__HIGHC__) /* Barf! */ pragma on(alloca); #define LOCAL_ALLOC(x) alloca(x) #define LOCAL_FREE(x) -extern pointer alloca PROTOTYPE((unsigned)); +extern pointer alloca (unsigned); #else /* no alloca? */ #define LOCAL_ALLOC(x) malloc(x) @@ -101,10 +89,10 @@ typedef struct _ss_data { /* init values */ (*code_ptr=0,ss_info(sci_idx)->current_request) void ss_unknown_function(); void ss_delete_info_dir(); -char **ss_parse PROTOTYPE((int, char *, int *)); -ss_abbrev_info *ss_abbrev_initialize PROTOTYPE((char *, int *)); -void ss_page_stdin PROTOTYPE((void)); -int ss_pager_create PROTOTYPE((void)); +char **ss_parse (int, char *, int *); +ss_abbrev_info *ss_abbrev_initialize (char *, int *); +void ss_page_stdin (void); +int ss_pager_create (void); void ss_self_identify __SS_PROTO; void ss_subsystem_name __SS_PROTO; void ss_subsystem_version __SS_PROTO; @@ -114,9 +102,9 @@ extern ss_data **_ss_table; extern char *ss_et_msgs[]; #ifndef HAVE_STDLIB_H -extern pointer malloc PROTOTYPE((unsigned)); -extern pointer realloc PROTOTYPE((pointer, unsigned)); -extern pointer calloc PROTOTYPE((unsigned, unsigned)); +extern pointer malloc (unsigned); +extern pointer realloc (pointer, unsigned); +extern pointer calloc (unsigned, unsigned); #endif #if defined(USE_SIGPROCMASK) && !defined(POSIX_SIGNALS) |
