]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
idnode api: little cleanup
authorJaroslav Kysela <perex@perex.cz>
Thu, 25 Sep 2014 12:48:07 +0000 (14:48 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 25 Sep 2014 12:48:07 +0000 (14:48 +0200)
src/api.h
src/api/api_idnode.c

index 0655865b9d36863951821f8b614b24452a0f6f9f..c80a2f4c56d6ae643bef2d18cebc495aef6bbc32 100644 (file)
--- a/src/api.h
+++ b/src/api.h
@@ -80,9 +80,8 @@ void api_dvr_init           ( void );
  */
 typedef struct api_idnode_grid_conf
 {
-  int             tindex;
-  int             start;
-  int             limit;
+  uint32_t        start;
+  uint32_t        limit;
   idnode_filter_t filter;
   idnode_sort_t   sort;
 } api_idnode_grid_conf_t;
index 4cf0bf1c49d5a9a2c1925b61a4023f1e750fa98f..d3330f9c115f0657117e8cb7edc543259904ade8 100644 (file)
@@ -61,17 +61,8 @@ api_idnode_grid_conf
   htsmsg_t *filter, *e;
   const char *str;
 
-  /* Start */
-  if ((str = htsmsg_get_str(args, "start")))
-    conf->start = atoi(str);
-  else
-    conf->start = 0;
-
-  /* Limit */
-  if ((str = htsmsg_get_str(args, "limit")))
-    conf->limit = atoi(str);
-  else
-    conf->limit = 50;
+  conf->start = htsmsg_get_u32_or_default(args, "start", 0);
+  conf->limit = htsmsg_get_u32_or_default(args, "limit", 50);
 
   /* Filter */
   if ((filter = htsmsg_get_list(args, "filter"))) {