From 98d8b56c7d9a1865492fe4bb23d28674162b7050 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. Reviewed-on: http://gerrit.openafs.org/7066 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 46c5aabfc6f5af2875e8b20252a17955ad89dd38) Change-Id: Ifee3178e5cdc2eab947f759541864ecea4345b7a Reviewed-on: http://gerrit.openafs.org/10867 Reviewed-by: D Brashear Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand --- 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 47490faa0..930604987 100644 --- a/src/bozo/bos.c +++ b/src/bozo/bos.c @@ -870,9 +870,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 8c51fa403..391d17fe0 100644 --- a/src/bozo/bos_util.c +++ b/src/bozo/bos_util.c @@ -91,7 +91,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