summaryrefslogtreecommitdiffstats
path: root/test/control.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-16 08:58:55 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de>2011-03-16 08:58:55 +0100
commit54a229b3864fe7867da69ef7427877094a256f1c (patch)
tree44b314944e24f3ef522360d76255bbc21ea36e12 /test/control.c
parent98511f7a77e7b37f9508b66298d99d7d1103e422 (diff)
downloaduca-54a229b3864fe7867da69ef7427877094a256f1c.tar.gz
uca-54a229b3864fe7867da69ef7427877094a256f1c.tar.bz2
uca-54a229b3864fe7867da69ef7427877094a256f1c.tar.xz
uca-54a229b3864fe7867da69ef7427877094a256f1c.zip
Pass target string size when calling uca_get_property
Diffstat (limited to 'test/control.c')
-rw-r--r--test/control.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/control.c b/test/control.c
index a8c7079..6024c08 100644
--- a/test/control.c
+++ b/test/control.c
@@ -206,7 +206,8 @@ void fill_tree_store(GtkTreeStore *tree_store, struct uca_camera_t *cam)
{
GtkTreeIter iter, child;
struct uca_property_t *property;
- gchar *value_string = g_malloc(256);
+ const size_t num_bytes = 256;
+ gchar *value_string = g_malloc(num_bytes);
guint8 value_8;
guint32 value_32;
@@ -215,16 +216,16 @@ void fill_tree_store(GtkTreeStore *tree_store, struct uca_camera_t *cam)
uint32_t result = UCA_NO_ERROR;
switch (property->type) {
case uca_string:
- result = cam->get_property(cam, prop_id, value_string);
+ result = cam->get_property(cam, prop_id, value_string, num_bytes);
break;
case uca_uint8t:
- result = cam->get_property(cam, prop_id, &value_8);
+ result = cam->get_property(cam, prop_id, &value_8, 0);
g_sprintf(value_string, "%d", value_8);
break;
case uca_uint32t:
- result = cam->get_property(cam, prop_id, &value_32);
+ result = cam->get_property(cam, prop_id, &value_32, 0);
g_sprintf(value_string, "%d", value_32);
break;
}
@@ -281,9 +282,9 @@ int main(int argc, char *argv[])
int width, height, bits_per_sample;
struct uca_camera_t *cam = uca->cameras;
- cam->get_property(cam, UCA_PROP_WIDTH, &width);
- cam->get_property(cam, UCA_PROP_HEIGHT, &height);
- cam->get_property(cam, UCA_PROP_BITDEPTH, &bits_per_sample);
+ cam->get_property(cam, UCA_PROP_WIDTH, &width, 0);
+ cam->get_property(cam, UCA_PROP_HEIGHT, &height, 0);
+ cam->get_property(cam, UCA_PROP_BITDEPTH, &bits_per_sample, 0);
g_thread_init(NULL);
gdk_threads_init();