From 73eabece3365c1bb47bf6b009682219c4492fda5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 11 Dec 2004 00:10:41 +0000 Subject: * add first part of zeroconf publisher * bump version to 0.7.1. * improve logging subsystem (introducing log levels) * remove verbose flag on cli * add new API pa_sample_format_to_string() * replace strtol() by usages of pa_atou() and pa_atoi() git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@317 fefdeb5f-60dc-0310-8127-8f9354f1896f --- polyp/modargs.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'polyp/modargs.c') diff --git a/polyp/modargs.c b/polyp/modargs.c index 406f610f..9437d839 100644 --- a/polyp/modargs.c +++ b/polyp/modargs.c @@ -190,41 +190,27 @@ const char *pa_modargs_get_value(struct pa_modargs *ma, const char *key, const c int pa_modargs_get_value_u32(struct pa_modargs *ma, const char *key, uint32_t *value) { const char *v; - char *e; - unsigned long l; assert(ma && key && value); if (!(v = pa_modargs_get_value(ma, key, NULL))) return 0; - if (!*v) - return -1; - - l = strtoul(v, &e, 0); - if (*e) + if (pa_atou(v, value) < 0) return -1; - *value = (uint32_t) l; return 0; } int pa_modargs_get_value_s32(struct pa_modargs *ma, const char *key, int32_t *value) { const char *v; - char *e; - signed long l; assert(ma && key && value); if (!(v = pa_modargs_get_value(ma, key, NULL))) return 0; - if (!*v) + if (pa_atoi(v, value) < 0) return -1; - - l = strtol(v, &e, 0); - if (*e) - return -1; - - *value = (int32_t) l; + return 0; } -- cgit