From 46c5aabfc6f5af2875e8b20252a17955ad89dd38 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Thu, 5 Apr 2012 15:50:35 -0400 Subject: [PATCH] bos: Change to using char casts for ka functions The ka_IsZero and ka_PrintBytes function just use char strings. Cast directly, rather than going via a helper functions to simplify this code. The helper functions add complexity, and additional dependencies which cause problems with some uses of this code. Change-Id: I831ff0f8fbecec602d8c2b9112675938facfb06b Reviewed-on: http://gerrit.openafs.org/7066 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/bozo/bos.c | 5 +++-- src/bozo/bos_util.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bozo/bos.c b/src/bozo/bos.c index fe9ea215e..5399ed90a 100644 --- a/src/bozo/bos.c +++ b/src/bozo/bos.c @@ -888,9 +888,10 @@ ListKeys(struct cmd_syndesc *as, void *arock) break; everWorked = 1; /* first check if key is returned */ - if ((!ka_KeyIsZero(ktc_to_charptr(&tkey), sizeof(tkey))) && (as->parms[1].items)) { + if ((!ka_KeyIsZero((char *)&tkey, sizeof(tkey))) + && (as->parms[1].items)) { printf("key %d is '", kvno); - ka_PrintBytes(ktc_to_charptr(&tkey), sizeof(tkey)); + ka_PrintBytes((char *)&tkey, sizeof(tkey)); printf("'\n"); } else { if (keyInfo.keyCheckSum == 0) /* shouldn't happen */ diff --git a/src/bozo/bos_util.c b/src/bozo/bos_util.c index 5aab9de31..2a7e62af2 100644 --- a/src/bozo/bos_util.c +++ b/src/bozo/bos_util.c @@ -86,7 +86,7 @@ main(int argc, char **argv) exit(1); } ka_StringToKey(buf, tcell, &tkey); - code = afsconf_AddKey(tdir, kvno, ktc_to_charptr(&tkey), 0); + code = afsconf_AddKey(tdir, kvno, (char *)&tkey, 0); if (code) { printf("bos_util: failed to set key, code %d.\n", code); exit(1); -- 2.39.5