summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2011-09-04 23:52:34 +0000
committerKen Raeburn <raeburn@mit.edu>2011-09-04 23:52:34 +0000
commit4ba58f9b6b7ccb372f09e31ee3d302ffafd50b15 (patch)
treef0d339ede66f7af9153dd1fe016a46ee3aa5d372 /src/util
parent3b5d496d3d63b28ebd2e23242a3422b1fa838e18 (diff)
downloadkrb5-4ba58f9b6b7ccb372f09e31ee3d302ffafd50b15.tar.gz
krb5-4ba58f9b6b7ccb372f09e31ee3d302ffafd50b15.tar.xz
krb5-4ba58f9b6b7ccb372f09e31ee3d302ffafd50b15.zip
Reindent per krb5-batch-reindent.el.
Some minor reformatting added in places to avoid exceeding 80 columns. Used Emacs 22.1 built-in C mode. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25144 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util')
-rw-r--r--src/util/gss-kernel-lib/t_kgss_kernel.c4
-rw-r--r--src/util/profile/profile_tcl.c1
-rw-r--r--src/util/profile/test_vtable.c42
-rw-r--r--src/util/profile/testmod/testmod_main.c6
-rw-r--r--src/util/support/path.c90
-rw-r--r--src/util/windows/getopt.c2
6 files changed, 72 insertions, 73 deletions
diff --git a/src/util/gss-kernel-lib/t_kgss_kernel.c b/src/util/gss-kernel-lib/t_kgss_kernel.c
index b529620d9..890a7d949 100644
--- a/src/util/gss-kernel-lib/t_kgss_kernel.c
+++ b/src/util/gss-kernel-lib/t_kgss_kernel.c
@@ -44,7 +44,7 @@ check(OM_uint32 major, OM_uint32 minor, const char *fn)
if (!GSS_ERROR(major))
return;
fprintf(stderr, "t_kgss_kernel: %s: major %u, minor %u\n", fn, major,
- minor);
+ minor);
/* libkgss doesn't have gss_display_status. */
exit(1);
}
@@ -175,7 +175,7 @@ send_wrap_token(gss_ctx_id_t ctx)
buf.value = "kernelwrap";
buf.length = 10;
major = krb5_gss_wrap(&minor, ctx, 1, GSS_C_QOP_DEFAULT, &buf, NULL,
- &wrapped);
+ &wrapped);
check(major, minor, "krb5_gss_wrap");
send_data(STDOUT_FILENO, wrapped.value, wrapped.length);
free(wrapped.value);
diff --git a/src/util/profile/profile_tcl.c b/src/util/profile/profile_tcl.c
index 613124a0a..505fb801f 100644
--- a/src/util/profile/profile_tcl.c
+++ b/src/util/profile/profile_tcl.c
@@ -3363,4 +3363,3 @@ SWIGEXPORT int SWIG_init(Tcl_Interp *interp) {
return TCL_OK;
}
-
diff --git a/src/util/profile/test_vtable.c b/src/util/profile/test_vtable.c
index 6370f2788..9a0b2278a 100644
--- a/src/util/profile/test_vtable.c
+++ b/src/util/profile/test_vtable.c
@@ -60,7 +60,7 @@ free_values(void *cbdata, char **values)
char **v;
for (v = values; *v; v++)
- free(*v);
+ free(*v);
free(values);
}
@@ -70,14 +70,14 @@ full_get_values(void *cbdata, const char *const *names, char ***ret_values)
assert(cbdata == &full_cbdata);
*ret_values = calloc(2, sizeof(*ret_values));
if (names[0] == name_string)
- (*ret_values)[0] = strdup("string result");
+ (*ret_values)[0] = strdup("string result");
else if (names[0] == name_int)
- (*ret_values)[0] = strdup("23");
+ (*ret_values)[0] = strdup("23");
else if (names[0] == name_bool)
- (*ret_values)[0] = strdup("on");
+ (*ret_values)[0] = strdup("on");
else {
- free(*ret_values);
- return PROF_NO_RELATION;
+ free(*ret_values);
+ return PROF_NO_RELATION;
}
(*ret_values)[1] = NULL;
return 0;
@@ -103,7 +103,7 @@ struct iterator {
static long
full_iterator_create(void *cbdata, const char *const *names, int flags,
- void **ret_iter)
+ void **ret_iter)
{
struct iterator *iter;
@@ -124,14 +124,14 @@ full_iterator(void *cbdata, void *iter_arg, char **ret_name, char **ret_value)
assert(cbdata == &full_cbdata);
assert(iter->count >= 0 && iter->count <= 2);
if (iter->count == 0) {
- *ret_name = strdup("name1");
- *ret_value = strdup("value1");
+ *ret_name = strdup("name1");
+ *ret_value = strdup("value1");
} else if (iter->count == 1) {
- *ret_name = strdup("name2");
- *ret_value = NULL;
+ *ret_name = strdup("name2");
+ *ret_value = NULL;
} else {
- *ret_name = NULL;
- *ret_value = NULL;
+ *ret_name = NULL;
+ *ret_value = NULL;
}
iter->count++;
return 0;
@@ -141,7 +141,7 @@ static void
full_iterator_free(void *cbdata, void *iter_arg)
{
struct iterator *iter = iter_arg;
-
+
assert(cbdata == &full_cbdata);
assert(iter->count == 3);
free(iter);
@@ -172,7 +172,7 @@ full_modified(void *cbdata, int *modified)
static long
full_update_relation(void *cbdata, const char **names,
- const char *old_value, const char *new_value)
+ const char *old_value, const char *new_value)
{
assert(cbdata == &full_cbdata);
assert(names == empty_names);
@@ -246,13 +246,13 @@ int main()
assert(values[2] == NULL);
profile_free_list(values);
assert(profile_iterator_create(profile, NULL, 0, &iter) ==
- PROF_UNSUPPORTED);
+ PROF_UNSUPPORTED);
assert(profile_is_writable(profile, &intval) == 0);
assert(intval == 0);
assert(profile_is_modified(profile, &intval) == 0);
assert(intval == 0);
assert(profile_update_relation(profile, NULL, NULL, NULL) ==
- PROF_UNSUPPORTED);
+ PROF_UNSUPPORTED);
assert(profile_clear_relation(profile, NULL) == PROF_UNSUPPORTED);
assert(profile_rename_section(profile, NULL, NULL) == PROF_UNSUPPORTED);
assert(profile_add_relation(profile, NULL, NULL) == PROF_UNSUPPORTED);
@@ -261,14 +261,14 @@ int main()
assert(profile_init_vtable(&full_vtable, &full_cbdata, &profile) == 0);
assert(profile_get_string(profile, name_string, NULL, NULL, "wrong",
- &str) == 0);
+ &str) == 0);
assert(strcmp(str, "string result") == 0);
profile_release_string(str);
assert(profile_get_integer(profile, name_int, NULL, NULL, 24,
- &intval) == 0);
+ &intval) == 0);
assert(intval == 23);
assert(profile_get_boolean(profile, name_bool, NULL, NULL, 0,
- &intval) == 0);
+ &intval) == 0);
assert(intval == 1);
assert(profile_get_integer(profile, "xxx", NULL, NULL, 62, &intval) == 0);
assert(intval == 62);
@@ -293,7 +293,7 @@ int main()
assert(profile_is_modified(profile, &intval) == 0);
assert(intval == 6);
assert(profile_update_relation(profile, empty_names, name_string,
- NULL) == 0);
+ NULL) == 0);
assert(profile_clear_relation(profile, empty_names) == 0);
assert(profile_rename_section(profile, empty_names, name_int) == 0);
assert(profile_add_relation(profile, empty_names, name_bool) == 0);
diff --git a/src/util/profile/testmod/testmod_main.c b/src/util/profile/testmod/testmod_main.c
index c58ac0487..126b199dc 100644
--- a/src/util/profile/testmod/testmod_main.c
+++ b/src/util/profile/testmod/testmod_main.c
@@ -56,7 +56,7 @@ free_values(void *cbdata, char **values)
char **v;
for (v = values; *v; v++)
- free(*v);
+ free(*v);
free(values);
}
@@ -83,11 +83,11 @@ copy(void *cbdata, void **ret_cbdata)
long
profile_module_init(const char *residual, struct profile_vtable *vtable,
- void **cb_ret);
+ void **cb_ret);
long
profile_module_init(const char *residual, struct profile_vtable *vtable,
- void **cb_ret)
+ void **cb_ret)
{
struct data *d;
diff --git a/src/util/support/path.c b/src/util/support/path.c
index 221fb4a6a..7a051abc9 100644
--- a/src/util/support/path.c
+++ b/src/util/support/path.c
@@ -54,9 +54,9 @@ find_sep(const char *path)
slash = strrchr(path, '/');
backslash = strrchr(path, '\\');
if (slash != NULL && backslash != NULL)
- return (slash > backslash) ? slash : backslash;
+ return (slash > backslash) ? slash : backslash;
else
- return (slash != NULL) ? slash : backslash;
+ return (slash != NULL) ? slash : backslash;
#else
return strrchr(path, '/');
#endif
@@ -70,50 +70,50 @@ k5_path_split(const char *path, char **parent_out, char **basename_out)
char *parent = NULL, *basename = NULL;
if (parent_out != NULL)
- *parent_out = NULL;
+ *parent_out = NULL;
if (basename_out != NULL)
- *basename_out = NULL;
+ *basename_out = NULL;
pathstart = path;
#ifdef WINDOWS_PATHS
if (*path != '\0' && path[1] == ':')
- pathstart = path + 2;
+ pathstart = path + 2;
#endif
sep = find_sep(pathstart);
if (sep != NULL) {
- bstart = sep + 1;
- /* Strip off excess separators before the one we found. */
- pend = sep;
- while (pend > pathstart && IS_SEPARATOR(pend[-1]))
- pend--;
- /* But if we hit the start, keep the whole separator sequence. */
- if (pend == pathstart)
- pend = sep + 1;
+ bstart = sep + 1;
+ /* Strip off excess separators before the one we found. */
+ pend = sep;
+ while (pend > pathstart && IS_SEPARATOR(pend[-1]))
+ pend--;
+ /* But if we hit the start, keep the whole separator sequence. */
+ if (pend == pathstart)
+ pend = sep + 1;
} else {
- bstart = pathstart;
- pend = pathstart;
+ bstart = pathstart;
+ pend = pathstart;
}
if (parent_out) {
- parent = malloc(pend - path + 1);
- if (parent == NULL)
- return ENOMEM;
- memcpy(parent, path, pend - path);
- parent[pend - path] = '\0';
+ parent = malloc(pend - path + 1);
+ if (parent == NULL)
+ return ENOMEM;
+ memcpy(parent, path, pend - path);
+ parent[pend - path] = '\0';
}
if (basename_out) {
- basename = strdup(bstart);
- if (basename == NULL) {
- free(parent);
- return ENOMEM;
- }
+ basename = strdup(bstart);
+ if (basename == NULL) {
+ free(parent);
+ return ENOMEM;
+ }
}
if (parent_out)
- *parent_out = parent;
+ *parent_out = parent;
if (basename_out)
- *basename_out = basename;
+ *basename_out = basename;
return 0;
}
@@ -125,24 +125,24 @@ k5_path_join(const char *path1, const char *path2, char **path_out)
*path_out = NULL;
if (k5_path_isabs(path2) || *path1 == '\0') {
- /* Discard path1 and return a copy of path2. */
- path = strdup(path2);
- if (path == NULL)
- return ENOMEM;
+ /* Discard path1 and return a copy of path2. */
+ path = strdup(path2);
+ if (path == NULL)
+ return ENOMEM;
} else {
- /*
- * Compose path1 and path2, adding a separator if path1 is non-empty
- * there's no separator between them already. (*path2 can be a
- * separator in the weird case where it starts with /: or \: on
- * Windows, and Python doesn't insert a separator in this case.)
- */
- c = path1[strlen(path1) - 1];
- if (IS_SEPARATOR(c) || IS_SEPARATOR(*path2))
- ret = asprintf(&path, "%s%s", path1, path2);
- else
- ret = asprintf(&path, "%s%c%s", path1, SEP, path2);
- if (ret < 0)
- return ENOMEM;
+ /*
+ * Compose path1 and path2, adding a separator if path1 is non-empty
+ * there's no separator between them already. (*path2 can be a
+ * separator in the weird case where it starts with /: or \: on
+ * Windows, and Python doesn't insert a separator in this case.)
+ */
+ c = path1[strlen(path1) - 1];
+ if (IS_SEPARATOR(c) || IS_SEPARATOR(*path2))
+ ret = asprintf(&path, "%s%s", path1, path2);
+ else
+ ret = asprintf(&path, "%s%c%s", path1, SEP, path2);
+ if (ret < 0)
+ return ENOMEM;
}
*path_out = path;
return 0;
@@ -153,7 +153,7 @@ k5_path_isabs(const char *path)
{
#ifdef WINDOWS_PATHS
if (*path != '\0' && path[1] == ':')
- path += 2;
+ path += 2;
return (*path == '/' || *path == '\\');
#else
return (*path == '/');
diff --git a/src/util/windows/getopt.c b/src/util/windows/getopt.c
index 3724a4ba5..4f9f0627e 100644
--- a/src/util/windows/getopt.c
+++ b/src/util/windows/getopt.c
@@ -144,7 +144,7 @@ getopt(nargc, nargv, ostr)
__progname, optopt);
return (BADCH);
}
- else /* white space */
+ else /* white space */
optarg = nargv[optind];
place = EMSG;
++optind;