summaryrefslogtreecommitdiff
path: root/common/attrs.c
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-01-23 14:29:25 +0100
committerStef Walter <stefw@gnome.org>2013-01-23 14:29:25 +0100
commitb28c936bd281c4b7ff9ed0f621b840f6d5a4b328 (patch)
tree9645b90b794908d378970aafd73e7726c5267341 /common/attrs.c
parent4671352fe2a4f56c6707322dcab0015e2e8600c4 (diff)
downloadp11-kit-b28c936bd281c4b7ff9ed0f621b840f6d5a4b328.tar.gz
Use the stdbool.h C99 bool type
It was getting really wild knowing whether a function returning an int would return -1 on failure or 0 or whether the int return value was actually a number etc..
Diffstat (limited to 'common/attrs.c')
-rw-r--r--common/attrs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/attrs.c b/common/attrs.c
index 2f4dca7..dd91afc 100644
--- a/common/attrs.c
+++ b/common/attrs.c
@@ -56,7 +56,7 @@ p11_attrs_count (CK_ATTRIBUTE *attrs)
CK_ULONG count;
if (attrs == NULL)
- return 0;
+ return 0UL;
for (count = 0; !p11_attrs_is_empty (attrs); count++, attrs++);
@@ -80,7 +80,7 @@ p11_attrs_free (void *attrs)
static CK_ATTRIBUTE *
attrs_build (CK_ATTRIBUTE *attrs,
CK_ULONG count_to_add,
- int copy,
+ bool copy,
CK_ATTRIBUTE * (*generator) (void *),
void *state)
{
@@ -147,14 +147,14 @@ p11_attrs_build (CK_ATTRIBUTE *attrs,
CK_ULONG count;
va_list va;
- count = 0;
+ count = 0UL;
va_start (va, attrs);
while (va_arg (va, CK_ATTRIBUTE *))
count++;
va_end (va);
va_start (va, attrs);
- attrs = attrs_build (attrs, count, 1, vararg_generator, va);
+ attrs = attrs_build (attrs, count, true, vararg_generator, va);
va_end (va);
return attrs;
@@ -172,7 +172,7 @@ p11_attrs_buildn (CK_ATTRIBUTE *attrs,
CK_ATTRIBUTE *add,
CK_ULONG count)
{
- return attrs_build (attrs, count, 1, template_generator, &add);
+ return attrs_build (attrs, count, true, template_generator, &add);
}
CK_ATTRIBUTE *
@@ -183,7 +183,7 @@ p11_attrs_take (CK_ATTRIBUTE *attrs,
{
CK_ATTRIBUTE attr = { type, value, length };
CK_ATTRIBUTE *add = &attr;
- return attrs_build (attrs, 1, 0, template_generator, &add);
+ return attrs_build (attrs, 1, false, template_generator, &add);
}
CK_ATTRIBUTE *