diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2018-06-20 11:39:00 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2018-06-20 11:39:00 +0200 |
commit | 147a25e6f8b276e17f8389d5047836b5ba3a6f34 (patch) | |
tree | aff9c00149de7f84719d8090ff14f2f7e44d26d5 | |
parent | d31c5019c623142841749a35d64b2333d0ba5cdb (diff) | |
download | ufo-filters-147a25e6f8b276e17f8389d5047836b5ba3a6f34.tar.gz ufo-filters-147a25e6f8b276e17f8389d5047836b5ba3a6f34.tar.bz2 ufo-filters-147a25e6f8b276e17f8389d5047836b5ba3a6f34.tar.xz ufo-filters-147a25e6f8b276e17f8389d5047836b5ba3a6f34.zip |
Use updated _get_requisition API
91 files changed, 241 insertions, 133 deletions
diff --git a/contrib/ufo-med-mad-reject-2d-task.c b/contrib/ufo-med-mad-reject-2d-task.c index b893fdc..7766309 100644 --- a/contrib/ufo-med-mad-reject-2d-task.c +++ b/contrib/ufo-med-mad-reject-2d-task.c @@ -95,9 +95,9 @@ ufo_med_mad_reject_2d_task_setup (UfoTask *task, static void ufo_med_mad_reject_2d_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { - // requisition->n_dims = 0; // Transferring the buffer «size» (size, data type and dimension) to the output ufo_buffer_get_requisition(inputs[0], requisition); } diff --git a/contrib/ufo-med-mad-reject-task.c b/contrib/ufo-med-mad-reject-task.c index 2c19c38..7c634d9 100644 --- a/contrib/ufo-med-mad-reject-task.c +++ b/contrib/ufo-med-mad-reject-task.c @@ -95,9 +95,9 @@ ufo_med_mad_reject_task_setup (UfoTask *task, static void ufo_med_mad_reject_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { - // requisition->n_dims = 0; // Transferring the buffer «size» (size, data type and dimension) to the output ufo_buffer_get_requisition(inputs[0], requisition); } diff --git a/contrib/ufo-ocl-1liner-task.c b/contrib/ufo-ocl-1liner-task.c index aa28a4c..e941fdd 100644 --- a/contrib/ufo-ocl-1liner-task.c +++ b/contrib/ufo-ocl-1liner-task.c @@ -131,7 +131,8 @@ ufo_ocl_1liner_task_setup (UfoTask *task, static void ufo_ocl_1liner_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { // In the current version of the kernel all the inputs are supposed to have the same dimensions // Or more precisely the output has the same dimension as first input (indexed 0) and one work-item diff --git a/contrib/ufo-stat-monitor-task.c b/contrib/ufo-stat-monitor-task.c index 5c04fe9..2a11d6d 100644 --- a/contrib/ufo-stat-monitor-task.c +++ b/contrib/ufo-stat-monitor-task.c @@ -197,7 +197,8 @@ ufo_stat_monitor_task_setup (UfoTask *task, static void ufo_stat_monitor_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { /* In the current version the statistics are NEVER the output of the filter. * Indeed is behaving as a /pass-through/ filter, doing nothing to the diff --git a/src/ufo-average-task.c b/src/ufo-average-task.c index 6566019..6e77ccb 100644 --- a/src/ufo-average-task.c +++ b/src/ufo-average-task.c @@ -62,8 +62,9 @@ ufo_average_task_setup (UfoTask *task, static void ufo_average_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { UfoAverageTaskPrivate *priv; diff --git a/src/ufo-backproject-task.c b/src/ufo-backproject-task.c index 35d3c4e..c123aeb 100644 --- a/src/ufo-backproject-task.c +++ b/src/ufo-backproject-task.c @@ -211,7 +211,8 @@ release_lut_mems (UfoBackprojectTaskPrivate *priv) static void ufo_backproject_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoBackprojectTaskPrivate *priv; UfoRequisition in_req; @@ -227,8 +228,11 @@ ufo_backproject_task_get_requisition (UfoTask *task, priv->burst_projections = (guint) in_req.dims[1]; if (priv->burst_projections > priv->n_projections) { - g_error("Total number of projections (%u) must be greater than " - "or equal to sinogram height (%u)", priv->n_projections, priv->burst_projections); + g_set_error (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "Total number of projections (%u) must be greater than " + "or equal to sinogram height (%u)", + priv->n_projections, priv->burst_projections); + return; } requisition->n_dims = 2; diff --git a/src/ufo-bin-task.c b/src/ufo-bin-task.c index 9713b51..866a6b8 100644 --- a/src/ufo-bin-task.c +++ b/src/ufo-bin-task.c @@ -77,7 +77,8 @@ ufo_bin_task_setup (UfoTask *task, static void ufo_bin_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoBinTaskPrivate *priv; UfoRequisition in_req; diff --git a/src/ufo-binarize-task.c b/src/ufo-binarize-task.c index 913300c..ce9467b 100644 --- a/src/ufo-binarize-task.c +++ b/src/ufo-binarize-task.c @@ -70,7 +70,8 @@ ufo_binarize_task_setup (UfoTask *task, static void ufo_binarize_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-blur-task.c b/src/ufo-blur-task.c index e3a0220..16b4b41 100644 --- a/src/ufo-blur-task.c +++ b/src/ufo-blur-task.c @@ -87,8 +87,9 @@ ufo_blur_task_setup (UfoTask *task, static void ufo_blur_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { UfoBlurTaskPrivate *priv; diff --git a/src/ufo-buffer-task.c b/src/ufo-buffer-task.c index 89825ad..199098d 100644 --- a/src/ufo-buffer-task.c +++ b/src/ufo-buffer-task.c @@ -94,7 +94,8 @@ ufo_buffer_task_setup (UfoTask *task, static void ufo_buffer_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoBufferTaskPrivate *priv; diff --git a/src/ufo-calculate-task.c b/src/ufo-calculate-task.c index c617314..0c5cac5 100644 --- a/src/ufo-calculate-task.c +++ b/src/ufo-calculate-task.c @@ -108,7 +108,8 @@ ufo_calculate_task_setup (UfoTask *task, static void ufo_calculate_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-center-of-rotation-task.c b/src/ufo-center-of-rotation-task.c index aa200fa..c66e234 100644 --- a/src/ufo-center-of-rotation-task.c +++ b/src/ufo-center-of-rotation-task.c @@ -64,7 +64,8 @@ ufo_center_of_rotation_task_setup (UfoTask *task, static void ufo_center_of_rotation_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { requisition->n_dims = 0; } diff --git a/src/ufo-clip-task.c b/src/ufo-clip-task.c index 78eb5a9..243d00e 100644 --- a/src/ufo-clip-task.c +++ b/src/ufo-clip-task.c @@ -80,7 +80,8 @@ ufo_clip_task_setup (UfoTask *task, static void ufo_clip_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-concatenate-result-task.c b/src/ufo-concatenate-result-task.c index 5fc01c8..5a80272 100644 --- a/src/ufo-concatenate-result-task.c +++ b/src/ufo-concatenate-result-task.c @@ -77,8 +77,9 @@ ufo_concatenate_result_task_setup (UfoTask *task, static void ufo_concatenate_result_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { requisition->n_dims = 1; /* Output size varies according to number of inputs to merge, and data diff --git a/src/ufo-contrast-task.c b/src/ufo-contrast-task.c index 4f68f75..6712845 100644 --- a/src/ufo-contrast-task.c +++ b/src/ufo-contrast-task.c @@ -72,7 +72,8 @@ ufo_contrast_task_setup (UfoTask *task, static void ufo_contrast_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition(inputs[0], requisition); } diff --git a/src/ufo-correlate-stacks-task.c b/src/ufo-correlate-stacks-task.c index ff4be50..de98c74 100644 --- a/src/ufo-correlate-stacks-task.c +++ b/src/ufo-correlate-stacks-task.c @@ -101,7 +101,8 @@ ufo_correlate_stacks_task_setup (UfoTask *task, static void ufo_correlate_stacks_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoCorrelateStacksTaskPrivate *priv; UfoRequisition ref_req; diff --git a/src/ufo-crop-task.c b/src/ufo-crop-task.c index cb53662..80d3a18 100644 --- a/src/ufo-crop-task.c +++ b/src/ufo-crop-task.c @@ -72,7 +72,8 @@ ufo_crop_task_setup (UfoTask *task, static void ufo_crop_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoCropTaskPrivate *priv; UfoRequisition in_req; diff --git a/src/ufo-cut-sinogram-task.c b/src/ufo-cut-sinogram-task.c index 2e586af..4eb02c9 100644 --- a/src/ufo-cut-sinogram-task.c +++ b/src/ufo-cut-sinogram-task.c @@ -68,8 +68,9 @@ ufo_cut_sinogram_task_setup (UfoTask *task, static void ufo_cut_sinogram_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { UfoCutSinogramTaskPrivate *priv = UFO_CUT_SINOGRAM_TASK_GET_PRIVATE (task); diff --git a/src/ufo-cut-task.c b/src/ufo-cut-task.c index 5ba43d7..fcf5d9d 100644 --- a/src/ufo-cut-task.c +++ b/src/ufo-cut-task.c @@ -70,7 +70,8 @@ ufo_cut_task_setup (UfoTask *task, static void ufo_cut_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoCutTaskPrivate *priv; UfoRequisition in_req; @@ -80,8 +81,9 @@ ufo_cut_task_get_requisition (UfoTask *task, ufo_buffer_get_requisition (inputs[0], &in_req); if (priv->width >= in_req.dims[0]) { - g_warning ("Width %u larger than input width %zu", priv->width, in_req.dims[0]); - width = 2; + g_set_error (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "Cut width %u larger than input width %zu", priv->width, in_req.dims[0]); + return; } else { width = in_req.dims[0] - priv->width; diff --git a/src/ufo-cv-show-task.cpp b/src/ufo-cv-show-task.cpp index d60a50b..c901766 100644 --- a/src/ufo-cv-show-task.cpp +++ b/src/ufo-cv-show-task.cpp @@ -67,7 +67,8 @@ ufo_cv_show_task_setup (UfoTask *task, static void ufo_cv_show_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-denoise-task.c b/src/ufo-denoise-task.c index 4d8293c..c3da254 100644 --- a/src/ufo-denoise-task.c +++ b/src/ufo-denoise-task.c @@ -91,7 +91,8 @@ ufo_denoise_task_setup (UfoTask *task, static void ufo_denoise_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-detect-edge-task.c b/src/ufo-detect-edge-task.c index 4009d31..a0a4f9e 100644 --- a/src/ufo-detect-edge-task.c +++ b/src/ufo-detect-edge-task.c @@ -103,7 +103,8 @@ ufo_detect_edge_task_setup (UfoTask *task, static void ufo_detect_edge_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-dfi-sinc-task.c b/src/ufo-dfi-sinc-task.c index d01bba0..3245a9c 100644 --- a/src/ufo-dfi-sinc-task.c +++ b/src/ufo-dfi-sinc-task.c @@ -169,9 +169,9 @@ ufo_dfi_sinc_task_setup (UfoTask *task, static void ufo_dfi_sinc_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { - //set output requsition UfoRequisition input_requisition; ufo_buffer_get_requisition (inputs[0], &input_requisition); diff --git a/src/ufo-dummy-data-task.c b/src/ufo-dummy-data-task.c index e6c6aa3..af6dd61 100644 --- a/src/ufo-dummy-data-task.c +++ b/src/ufo-dummy-data-task.c @@ -77,8 +77,9 @@ ufo_dummy_data_task_setup (UfoTask *task, static void ufo_dummy_data_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { UfoDummyDataTaskPrivate *priv; diff --git a/src/ufo-dump-ring-task.c b/src/ufo-dump-ring-task.c index 36b81da..27491ab 100644 --- a/src/ufo-dump-ring-task.c +++ b/src/ufo-dump-ring-task.c @@ -61,7 +61,8 @@ ufo_dump_ring_task_setup (UfoTask *task, static void ufo_dump_ring_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition(inputs[0], requisition); } diff --git a/src/ufo-duplicate-task.c b/src/ufo-duplicate-task.c index 3541a90..5491362 100644 --- a/src/ufo-duplicate-task.c +++ b/src/ufo-duplicate-task.c @@ -53,7 +53,8 @@ ufo_duplicate_task_setup (UfoTask *task, static void ufo_duplicate_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition(inputs[0], requisition); } diff --git a/src/ufo-fft-task.c b/src/ufo-fft-task.c index 73154f7..a953791 100644 --- a/src/ufo-fft-task.c +++ b/src/ufo-fft-task.c @@ -101,7 +101,8 @@ ufo_fft_task_setup (UfoTask *task, static void ufo_fft_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoFftTaskPrivate *priv; UfoRequisition in_req; diff --git a/src/ufo-fftmult-task.c b/src/ufo-fftmult-task.c index 09db154..6e722c1 100644 --- a/src/ufo-fftmult-task.c +++ b/src/ufo-fftmult-task.c @@ -67,7 +67,8 @@ ufo_fftmult_task_setup (UfoTask *task, static void ufo_fftmult_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition(inputs[1], requisition); } diff --git a/src/ufo-filter-particle-task.c b/src/ufo-filter-particle-task.c index 0964b41..46d5ae5 100644 --- a/src/ufo-filter-particle-task.c +++ b/src/ufo-filter-particle-task.c @@ -70,7 +70,8 @@ ufo_filter_particle_task_setup (UfoTask *task, static void ufo_filter_particle_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoFilterParticleTaskPrivate *priv = UFO_FILTER_PARTICLE_TASK_GET_PRIVATE (task); requisition->n_dims = 1; diff --git a/src/ufo-filter-stripes-task.c b/src/ufo-filter-stripes-task.c index 48c707c..6a0eedd 100644 --- a/src/ufo-filter-stripes-task.c +++ b/src/ufo-filter-stripes-task.c @@ -95,8 +95,9 @@ ufo_filter_stripes_task_setup (UfoTask *task, static void ufo_filter_stripes_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-filter-stripes1d-task.c b/src/ufo-filter-stripes1d-task.c index fa36707..816f3aa 100644 --- a/src/ufo-filter-stripes1d-task.c +++ b/src/ufo-filter-stripes1d-task.c @@ -125,7 +125,8 @@ ufo_filter_stripes1d_task_setup (UfoTask *task, static void ufo_filter_stripes1d_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoFilterStripes1dTaskPrivate *priv; diff --git a/src/ufo-filter-task.c b/src/ufo-filter-task.c index 73697fe..64016eb 100644 --- a/src/ufo-filter-task.c +++ b/src/ufo-filter-task.c @@ -277,7 +277,8 @@ compute_faris_byer_coefficients (UfoFilterTaskPrivate *priv, static void ufo_filter_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoFilterTaskPrivate *priv; diff --git a/src/ufo-flat-field-correct-task.c b/src/ufo-flat-field-correct-task.c index 8fb615b..fe39439 100644 --- a/src/ufo-flat-field-correct-task.c +++ b/src/ufo-flat-field-correct-task.c @@ -76,9 +76,11 @@ ufo_flat_field_correct_task_setup (UfoTask *task, static void ufo_flat_field_correct_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { + /* TODO: check the size is the same for all three inputs */ ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-flatten-inplace-task.c b/src/ufo-flatten-inplace-task.c index dde1621..920834c 100644 --- a/src/ufo-flatten-inplace-task.c +++ b/src/ufo-flatten-inplace-task.c @@ -69,7 +69,8 @@ ufo_flatten_inplace_task_setup (UfoTask *task, static void ufo_flatten_inplace_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-flatten-task.c b/src/ufo-flatten-task.c index 6ec0fc3..36c45e7 100644 --- a/src/ufo-flatten-task.c +++ b/src/ufo-flatten-task.c @@ -75,7 +75,8 @@ ufo_flatten_task_setup (UfoTask *task, static void ufo_flatten_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); requisition->n_dims = 2; diff --git a/src/ufo-flip-task.c b/src/ufo-flip-task.c index 6799e0e..088d0f0 100644 --- a/src/ufo-flip-task.c +++ b/src/ufo-flip-task.c @@ -78,7 +78,8 @@ ufo_flip_task_setup (UfoTask *task, static void ufo_flip_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-forwardproject-task.c b/src/ufo-forwardproject-task.c index 3b729cd..6b59f9c 100644 --- a/src/ufo-forwardproject-task.c +++ b/src/ufo-forwardproject-task.c @@ -77,7 +77,8 @@ ufo_forwardproject_task_setup (UfoTask *task, static void ufo_forwardproject_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoForwardprojectTaskPrivate *priv; UfoRequisition in_req; diff --git a/src/ufo-gemm-task.c b/src/ufo-gemm-task.c index fcad5ef..eccbc0d 100644 --- a/src/ufo-gemm-task.c +++ b/src/ufo-gemm-task.c @@ -70,7 +70,8 @@ ufo_gemm_task_setup (UfoTask *task, static void ufo_gemm_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoGemmTaskPrivate *priv; UfoRequisition r_A; @@ -85,15 +86,17 @@ ufo_gemm_task_get_requisition (UfoTask *task, ufo_buffer_get_requisition (inputs[2], &r_C); if (r_B.dims[0] != r_A.dims[1]) { - g_warning ("A = <%zu, %zu> not compatible with B = <%zu, %zu>", - r_A.dims[0], r_A.dims[1], r_B.dims[0], r_B.dims[0]); + g_set_error (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "A = <%zu, %zu> not compatible with B = <%zu, %zu>", + r_A.dims[0], r_A.dims[1], r_B.dims[0], r_B.dims[0]); priv->error = TRUE; } if ((r_C.dims[0] != r_A.dims[0]) || (r_C.dims[1] != r_B.dims[1])) { - g_warning ("C = <%zu, %zu> not compatible with A = <%zu, %zu> and B = <%zu, %zu>", - r_C.dims[0], r_C.dims[1], r_A.dims[0], r_A.dims[1], r_B.dims[0], r_B.dims[1]); + g_set_error (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "C = <%zu, %zu> not compatible with A = <%zu, %zu> and B = <%zu, %zu>", + r_C.dims[0], r_C.dims[1], r_A.dims[0], r_A.dims[1], r_B.dims[0], r_B.dims[1]); priv->error = TRUE; } diff --git a/src/ufo-get-dup-circ-task.c b/src/ufo-get-dup-circ-task.c index 1c91b00..d0cc4ee 100644 --- a/src/ufo-get-dup-circ-task.c +++ b/src/ufo-get-dup-circ-task.c @@ -62,7 +62,8 @@ ufo_get_dup_circ_task_setup (UfoTask *task, static void ufo_get_dup_circ_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-gradient-task.c b/src/ufo-gradient-task.c index b3e4824..ce3f878 100644 --- a/src/ufo-gradient-task.c +++ b/src/ufo-gradient-task.c @@ -70,8 +70,8 @@ ufo_gradient_task_new (void) static void ufo_gradient_task_setup (UfoTask *task, - UfoResources *resources, - GError **error) + UfoResources *resources, + GError **error) { UfoGradientTaskPrivate *priv = UFO_GRADIENT_TASK_GET_PRIVATE (task); priv->kernel = ufo_resources_get_kernel (resources, "gradient.cl", @@ -83,7 +83,8 @@ ufo_gradient_task_setup (UfoTask *task, static void ufo_gradient_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-ifft-task.c b/src/ufo-ifft-task.c index 9d665ad..6a7ede4 100644 --- a/src/ufo-ifft-task.c +++ b/src/ufo-ifft-task.c @@ -83,12 +83,19 @@ ufo_ifft_task_setup (UfoTask *task, static void ufo_ifft_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoIfftTaskPrivate *priv; UfoRequisition in_req; cl_command_queue queue; + if (ufo_buffer_get_layout (inputs[0]) != UFO_BUFFER_LAYOUT_COMPLEX_INTERLEAVED) { + g_set_error_literal (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "ifft input must be complex"); + return; + } + priv = UFO_IFFT_TASK_GET_PRIVATE (task); ufo_buffer_get_requisition (inputs[0], &in_req); diff --git a/src/ufo-interpolate-stream-task.c b/src/ufo-interpolate-stream-task.c index f659972..f2a9ad7 100644 --- a/src/ufo-interpolate-stream-task.c +++ b/src/ufo-interpolate-stream-task.c @@ -75,7 +75,8 @@ ufo_interpolate_stream_task_setup (UfoTask *task, static void ufo_interpolate_stream_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { /* TODO: check it's the same all the time */ ufo_buffer_get_requisition (inputs[0], requisition); diff --git a/src/ufo-interpolate-task.c b/src/ufo-interpolate-task.c index d8f5dbc..a0d0725 100644 --- a/src/ufo-interpolate-task.c +++ b/src/ufo-interpolate-task.c @@ -76,7 +76,8 @@ ufo_interpolate_task_setup (UfoTask *task, static void ufo_interpolate_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { /* TODO: check for input compatibility */ ufo_buffer_get_requisition (inputs[0], requisition); diff --git a/src/ufo-lamino-backproject-task.c b/src/ufo-lamino-backproject-task.c index 4184595..a6e9863 100644 --- a/src/ufo-lamino-backproject-task.c +++ b/src/ufo-lamino-backproject-task.c @@ -243,7 +243,8 @@ ufo_lamino_backproject_task_setup (UfoTask *task, static void ufo_lamino_backproject_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoLaminoBackprojectTaskPrivate *priv; gfloat start, stop, step; diff --git a/src/ufo-loop-task.c b/src/ufo-loop-task.c index cd962e3..06054f1 100644 --- a/src/ufo-loop-task.c +++ b/src/ufo-loop-task.c @@ -58,7 +58,8 @@ ufo_loop_task_setup (UfoTask *task, static void ufo_loop_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-map-color-task.c b/src/ufo-map-color-task.c index 8376c5b..c807d94 100644 --- a/src/ufo-map-color-task.c +++ b/src/ufo-map-color-task.c @@ -180,7 +180,8 @@ ufo_map_color_task_setup (UfoTask *task, static void ufo_map_color_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); requisition->n_dims = 3; diff --git a/src/ufo-map-slice-task.c b/src/ufo-map-slice-task.c index 676e4a5..6b0df55 100644 --- a/src/ufo-map-slice-task.c +++ b/src/ufo-map-slice-task.c @@ -61,7 +61,8 @@ ufo_map_slice_task_setup (UfoTask *task, static void ufo_map_slice_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoMapSliceTaskPrivate *priv; UfoRequisition in_req; diff --git a/src/ufo-mask-task.c b/src/ufo-mask-task.c index 2905eeb..0d99bd6 100644 --- a/src/ufo-mask-task.c +++ b/src/ufo-mask-task.c @@ -61,7 +61,8 @@ ufo_mask_task_setup (UfoTask *task, static void ufo_mask_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-measure-sharpness-task.c b/src/ufo-measure-sharpness-task.c index ff86232..e1d47ba 100644 --- a/src/ufo-measure-sharpness-task.c +++ b/src/ufo-measure-sharpness-task.c @@ -57,7 +57,8 @@ ufo_measure_sharpness_task_setup (UfoTask *task, static void ufo_measure_sharpness_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { requisition->n_dims = 0; } diff --git a/src/ufo-measure-task.c b/src/ufo-measure-task.c index 6ff975e..eff40fb 100644 --- a/src/ufo-measure-task.c +++ b/src/ufo-measure-task.c @@ -205,7 +205,8 @@ get_output_size (UfoMeasureTaskPrivate *priv, static void ufo_measure_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoMeasureTaskPrivate *priv; UfoRequisition in_req; diff --git a/src/ufo-median-filter-task.c b/src/ufo-median-filter-task.c index 7972c4a..1467979 100644 --- a/src/ufo-median-filter-task.c +++ b/src/ufo-median-filter-task.c @@ -89,7 +89,8 @@ ufo_median_filter_task_setup (UfoTask *task, static void ufo_median_filter_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-memory-in-task.c b/src/ufo-memory-in-task.c index 2ad9908..6be47f3 100644 --- a/src/ufo-memory-in-task.c +++ b/src/ufo-memory-in-task.c @@ -74,7 +74,8 @@ ufo_memory_in_task_setup (UfoTask *task, static void ufo_memory_in_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoMemoryInTaskPrivate *priv; diff --git a/src/ufo-memory-out-task.c b/src/ufo-memory-out-task.c index f9d9421..e4ae9cf 100644 --- a/src/ufo-memory-out-task.c +++ b/src/ufo-memory-out-task.c @@ -75,7 +75,8 @@ ufo_memory_out_task_setup (UfoTask *task, static void ufo_memory_out_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-merge-task.c b/src/ufo-merge-task.c index d6839d9..34112c8 100644 --- a/src/ufo-merge-task.c +++ b/src/ufo-merge-task.c @@ -63,7 +63,8 @@ ufo_merge_task_setup (UfoTask *task, static void ufo_merge_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoMergeTaskPrivate *priv; diff --git a/src/ufo-metaballs-task.c b/src/ufo-metaballs-task.c index 656f3d7..32a4a42 100644 --- a/src/ufo-metaballs-task.c +++ b/src/ufo-metaballs-task.c @@ -112,7 +112,8 @@ ufo_metaballs_task_setup (UfoTask *task, static void ufo_metaballs_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoMetaballsTaskPrivate *priv; diff --git a/src/ufo-monitor-task.c b/src/ufo-monitor-task.c index bbe549e..71b4cae 100644 --- a/src/ufo-monitor-task.c +++ b/src/ufo-monitor-task.c @@ -56,7 +56,8 @@ ufo_monitor_task_setup (UfoTask *task, static void ufo_monitor_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-null-task.c b/src/ufo-null-task.c index 64ca347..c12babc 100644 --- a/src/ufo-null-task.c +++ b/src/ufo-null-task.c @@ -67,7 +67,8 @@ ufo_null_task_setup (UfoTask *task, static void ufo_null_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { requisition->n_dims = 0; } diff --git a/src/ufo-opencl-reduce-task.c b/src/ufo-opencl-reduce-task.c index be40233..787d178 100644 --- a/src/ufo-opencl-reduce-task.c +++ b/src/ufo-opencl-reduce-task.c @@ -134,7 +134,8 @@ ufo_opencl_reduce_task_setup (UfoTask *task, static void ufo_opencl_reduce_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-opencl-task.c b/src/ufo-opencl-task.c index 84e7b36..53ef8b2 100644 --- a/src/ufo-opencl-task.c +++ b/src/ufo-opencl-task.c @@ -161,7 +161,8 @@ ufo_opencl_task_setup (UfoTask *task, static void ufo_opencl_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-ordfilt-task.c b/src/ufo-ordfilt-task.c index 3efd689..fc1bed5 100644 --- a/src/ufo-ordfilt-task.c +++ b/src/ufo-ordfilt-task.c @@ -94,7 +94,8 @@ ufo_ordfilt_task_setup (UfoTask *task, static void ufo_ordfilt_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-pad-task.c b/src/ufo-pad-task.c index 027f3fd..f012b24 100644 --- a/src/ufo-pad-task.c +++ b/src/ufo-pad-task.c @@ -102,7 +102,8 @@ ufo_pad_task_setup (UfoTask *task, static void ufo_pad_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoPadTaskPrivate *priv; UfoRequisition in_req; diff --git a/src/ufo-polar-coordinates-task.c b/src/ufo-polar-coordinates-task.c index 7d1ea5e..91a7303 100644 --- a/src/ufo-polar-coordinates-task.c +++ b/src/ufo-polar-coordinates-task.c @@ -108,7 +108,8 @@ ufo_polar_coordinates_task_setup (UfoTask *task, static void ufo_polar_coordinates_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoPolarCoordinatesTaskPrivate *priv; UfoRequisition in_req; diff --git a/src/ufo-read-task.c b/src/ufo-read-task.c index 91c33f8..04886fe 100644 --- a/src/ufo-read-task.c +++ b/src/ufo-read-task.c @@ -253,7 +253,8 @@ get_reader (UfoReadTaskPrivate *priv, const gchar *filename) static void ufo_read_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoReadTaskPrivate *priv; const gchar *filename; diff --git a/src/ufo-reduce-task.c b/src/ufo-reduce-task.c index 7fb7384..54f64a0 100644 --- a/src/ufo-reduce-task.c +++ b/src/ufo-reduce-task.c @@ -53,7 +53,8 @@ ufo_reduce_task_setup (UfoTask *task, static void ufo_reduce_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition(inputs[0], requisition); requisition->dims[0] /= 2; diff --git a/src/ufo-refeed-task.c b/src/ufo-refeed-task.c index 73ae07d..936b236 100644 --- a/src/ufo-refeed-task.c +++ b/src/ufo-refeed-task.c @@ -60,7 +60,8 @@ ufo_refeed_task_setup (UfoTask *task, static void ufo_refeed_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoRefeedTaskPrivate *priv; diff --git a/src/ufo-remove-circle-task.c b/src/ufo-remove-circle-task.c index 52183ea..113d1ca 100644 --- a/src/ufo-remove-circle-task.c +++ b/src/ufo-remove-circle-task.c @@ -60,7 +60,8 @@ ufo_remove_circle_task_setup (UfoTask *task, static void ufo_remove_circle_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { /* At most we will have same sized buffer as input since we are only * removing circles */ diff --git a/src/ufo-remove-outliers-task.c b/src/ufo-remove-outliers-task.c index 604f077..1bea083 100644 --- a/src/ufo-remove-outliers-task.c +++ b/src/ufo-remove-outliers-task.c @@ -76,8 +76,9 @@ ufo_remove_outliers_task_setup (UfoTask *task, static void ufo_remove_outliers_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-replicate-task.c b/src/ufo-replicate-task.c index 98cb5cc..c9946d7 100644 --- a/src/ufo-replicate-task.c +++ b/src/ufo-replicate-task.c @@ -52,9 +52,10 @@ ufo_replicate_task_setup (UfoTask *task, static void ufo_replicate_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { - ufo_buffer_get_requisition(inputs[0], requisition); + ufo_buffer_get_requisition (inputs[0], requisition); } static guint diff --git a/src/ufo-rescale-task.c b/src/ufo-rescale-task.c index 6025c5d..ff0ab34 100644 --- a/src/ufo-rescale-task.c +++ b/src/ufo-rescale-task.c @@ -102,8 +102,9 @@ ufo_rescale_task_setup (UfoTask *task, static void ufo_rescale_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { UfoRescaleTaskPrivate *priv; UfoRequisition in_req; @@ -120,6 +121,7 @@ ufo_rescale_task_get_requisition (UfoTask *task, if (requisition->dims[0] == 0) { requisition->dims[0] = 1; } + if (requisition->dims[1] == 0) { requisition->dims[1] = 1; } diff --git a/src/ufo-retrieve-phase-task.c b/src/ufo-retrieve-phase-task.c index 89a4429..a7595a9 100644 --- a/src/ufo-retrieve-phase-task.c +++ b/src/ufo-retrieve-phase-task.c @@ -138,12 +138,14 @@ ufo_retrieve_phase_task_setup (UfoTask *task, static void ufo_retrieve_phase_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); if (!IS_POW_OF_2 (requisition->dims[0]) || !IS_POW_OF_2 (requisition->dims[1])) { - g_error("Please, perform zeropadding of your dataset along both directions (width, height) up to length of power of 2 (e.g. 256, 512, 1024, 2048, etc.)"); + g_set_error_literal (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "Please, perform zeropadding of your dataset along both directions (width, height) up to length of power of 2 (e.g. 256, 512, 1024, 2048, etc.)"); } } diff --git a/src/ufo-ring-pattern-task.c b/src/ufo-ring-pattern-task.c index 09571b7..b8dcb54 100644 --- a/src/ufo-ring-pattern-task.c +++ b/src/ufo-ring-pattern-task.c @@ -72,8 +72,9 @@ ufo_ring_pattern_task_setup (UfoTask *task, static void ufo_ring_pattern_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { UfoRingPatternTaskPrivate *priv = UFO_RING_PATTERN_TASK_GET_PRIVATE (task); requisition->dims[0] = priv->width; diff --git a/src/ufo-ringwriter-task.c b/src/ufo-ringwriter-task.c index 9cbc013..a9e4427 100644 --- a/src/ufo-ringwriter-task.c +++ b/src/ufo-ringwriter-task.c @@ -63,8 +63,9 @@ ufo_ringwriter_task_setup (UfoTask *task, static void ufo_ringwriter_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { requisition->n_dims = 0; } @@ -77,7 +78,7 @@ ufo_ringwriter_task_get_num_inputs (UfoTask *task) static guint ufo_ringwriter_task_get_num_dimensions (UfoTask *task, - guint input) + guint input) { return 1; } diff --git a/src/ufo-rotate-task.c b/src/ufo-rotate-task.c index 76cbe6f..eda4d87 100644 --- a/src/ufo-rotate-task.c +++ b/src/ufo-rotate-task.c @@ -143,7 +143,8 @@ ufo_rotate_task_setup (UfoTask *task, static void ufo_rotate_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoRotateTaskPrivate *priv; UfoRequisition in_req; diff --git a/src/ufo-segment-task.c b/src/ufo-segment-task.c index 234fb94..2554731 100644 --- a/src/ufo-segment-task.c +++ b/src/ufo-segment-task.c @@ -124,7 +124,8 @@ ufo_segment_task_setup (UfoTask *task, static void ufo_segment_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoRequisition label_req; @@ -136,8 +137,10 @@ ufo_segment_task_get_requisition (UfoTask *task, if ((label_req.dims[0] != requisition->dims[0]) || (label_req.dims[1] != requisition->dims[1])) { - g_warning ("Label field and input dimensions do not match ([%zu, %zu] != [%zu, %zu])", - label_req.dims[0], label_req.dims[1], requisition->dims[0], requisition->dims[1]); + + g_set_error (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "Label field and input dimensions do not match ([%zu, %zu] != [%zu, %zu])", + label_req.dims[0], label_req.dims[1], requisition->dims[0], requisition->dims[1]); } } diff --git a/src/ufo-sleep-task.c b/src/ufo-sleep-task.c index 2386bea..7c09074 100644 --- a/src/ufo-sleep-task.c +++ b/src/ufo-sleep-task.c @@ -62,7 +62,8 @@ ufo_sleep_task_setup (UfoTask *task, static void ufo_sleep_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-slice-task.c b/src/ufo-slice-task.c index 9e1551d..0fc14fe 100644 --- a/src/ufo-slice-task.c +++ b/src/ufo-slice-task.c @@ -57,7 +57,8 @@ ufo_slice_task_setup (UfoTask *task, static void ufo_slice_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoSliceTaskPrivate *priv; UfoRequisition in_req; diff --git a/src/ufo-stack-task.c b/src/ufo-stack-task.c index 46510ff..9270637 100644 --- a/src/ufo-stack-task.c +++ b/src/ufo-stack-task.c @@ -64,7 +64,8 @@ ufo_stack_task_setup (UfoTask *task, static void ufo_stack_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoStackTaskPrivate *priv; diff --git a/src/ufo-stamp-task.c b/src/ufo-stamp-task.c index 4fbf63a..11ea90f 100644 --- a/src/ufo-stamp-task.c +++ b/src/ufo-stamp-task.c @@ -123,7 +123,8 @@ ufo_stamp_task_setup (UfoTask *task, static void ufo_stamp_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-stdin-task.c b/src/ufo-stdin-task.c index b6e3dfd..c0d3a4e 100644 --- a/src/ufo-stdin-task.c +++ b/src/ufo-stdin-task.c @@ -64,7 +64,8 @@ ufo_stdin_task_setup (UfoTask *task, static void ufo_stdin_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoStdinTaskPrivate *priv; diff --git a/src/ufo-stitch-task.c b/src/ufo-stitch-task.c index 9491f54..f935899 100644 --- a/src/ufo-stitch-task.c +++ b/src/ufo-stitch-task.c @@ -94,7 +94,8 @@ ufo_stitch_task_setup (UfoTask *task, static void ufo_stitch_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoStitchTaskPrivate *priv; UfoRequisition left_req, right_req; @@ -103,8 +104,11 @@ ufo_stitch_task_get_requisition (UfoTask *task, ufo_buffer_get_requisition (inputs[0], &left_req); ufo_buffer_get_requisition (inputs[1], &right_req); - if (left_req.dims[1] != right_req.dims[1]) - g_warning ("Both inputs must have the same height"); + if (left_req.dims[1] != right_req.dims[1]) { + g_set_error_literal (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "Both stitch inputs must have the same height"); + return; + } priv->overlap = (priv->shift >= 0) ? left_req.dims[0] - priv->shift : right_req.dims[0] + priv->shift; requisition->n_dims = 2; diff --git a/src/ufo-subtract-task.c b/src/ufo-subtract-task.c index 0f10797..a381de5 100644 --- a/src/ufo-subtract-task.c +++ b/src/ufo-subtract-task.c @@ -72,7 +72,8 @@ ufo_subtract_task_setup (UfoTask *task, static void ufo_subtract_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); } diff --git a/src/ufo-swap-quadrants-task.c b/src/ufo-swap-quadrants-task.c index 5112831..0f786cc 100644 --- a/src/ufo-swap-quadrants-task.c +++ b/src/ufo-swap-quadrants-task.c @@ -67,7 +67,8 @@ ufo_swap_quadrants_task_setup (UfoTask *task, static void ufo_swap_quadrants_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoRequisition input_requisition; ufo_buffer_get_requisition (inputs[0], &input_requisition); diff --git a/src/ufo-tile-task.c b/src/ufo-tile-task.c index 1652f52..005d035 100644 --- a/src/ufo-tile-task.c +++ b/src/ufo-tile-task.c @@ -78,7 +78,8 @@ ufo_tile_task_setup (UfoTask *task, static void ufo_tile_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoTileTaskPrivate *priv; gsize in_width; @@ -91,18 +92,22 @@ ufo_tile_task_get_requisition (UfoTask *task, if (priv->width > 0) { if (priv->width > in_width) - g_error ("tile: width %u cannot be larger than %zu", priv->width, in_width); + g_set_error (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "tile: width %u cannot be larger than %zu", priv->width, in_width); else if (in_width % priv->width) - g_error ("tile: input width %zu must be a multiple of width %u", in_width, priv->width); + g_set_error (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "tile: input width %zu must be a multiple of width %u", in_width, priv->width); else requisition->dims[0] = priv->width; } if (priv->height > 0) { if (priv->height > in_height) - g_error ("tile: height %u cannot be larger than %zu", priv->height, in_height); + g_set_error (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "tile: height %u cannot be larger than %zu", priv->height, in_height); else if (requisition->dims[1] % priv->height) - g_error ("tile: input height %zu must be a multiple of height %u", in_height, priv->height); + g_set_error (error, UFO_TASK_ERROR, UFO_TASK_ERROR_GET_REQUISITION, + "tile: input height %zu must be a multiple of height %u", in_height, priv->height); else requisition->dims[1] = priv->height; } diff --git a/src/ufo-transpose-projections-task.c b/src/ufo-transpose-projections-task.c index f3ce3cc..c4780ae 100644 --- a/src/ufo-transpose-projections-task.c +++ b/src/ufo-transpose-projections-task.c @@ -125,8 +125,9 @@ ufo_transpose_projections_task_setup (UfoTask *task, static void ufo_transpose_projections_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { UfoTransposeProjectionsTaskPrivate *priv; UfoRequisition in_req; diff --git a/src/ufo-transpose-task.c b/src/ufo-transpose-task.c index d28a576..3a9130b 100644 --- a/src/ufo-transpose-task.c +++ b/src/ufo-transpose-task.c @@ -58,7 +58,8 @@ ufo_transpose_task_setup (UfoTask *task, static void ufo_transpose_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoRequisition in_req; diff --git a/src/ufo-unsplit-task.c b/src/ufo-unsplit-task.c index cc2dbf9..54d559b 100644 --- a/src/ufo-unsplit-task.c +++ b/src/ufo-unsplit-task.c @@ -61,7 +61,8 @@ ufo_unsplit_task_setup (UfoTask *task, static void ufo_unsplit_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { ufo_buffer_get_requisition (inputs[0], requisition); requisition->n_dims = 2; diff --git a/src/ufo-volume-render-task.c b/src/ufo-volume-render-task.c index 21bcfe5..c6393d0 100644 --- a/src/ufo-volume-render-task.c +++ b/src/ufo-volume-render-task.c @@ -113,7 +113,8 @@ ufo_volume_render_task_setup (UfoTask *task, static void ufo_volume_render_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoVolumeRenderTaskPrivate *priv; diff --git a/src/ufo-write-task.c b/src/ufo-write-task.c index d3c5027..80f4c5c 100644 --- a/src/ufo-write-task.c +++ b/src/ufo-write-task.c @@ -262,7 +262,8 @@ ufo_write_task_setup (UfoTask *task, static void ufo_write_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { requisition->n_dims = 0; } diff --git a/src/ufo-zeropad-task.c b/src/ufo-zeropad-task.c index 32b2ad1..ea823dc 100644 --- a/src/ufo-zeropad-task.c +++ b/src/ufo-zeropad-task.c @@ -79,8 +79,9 @@ ufo_zeropad_task_setup (UfoTask *task, static void ufo_zeropad_task_get_requisition (UfoTask *task, - UfoBuffer **inputs, - UfoRequisition *requisition) + UfoBuffer **inputs, + UfoRequisition *requisition, + GError **error) { UfoZeropadTaskPrivate *priv = UFO_ZEROPAD_TASK_GET_PRIVATE (task); diff --git a/src/ufo-zmq-pub-task.c b/src/ufo-zmq-pub-task.c index a9beed0..8b11a02 100644 --- a/src/ufo-zmq-pub-task.c +++ b/src/ufo-zmq-pub-task.c @@ -145,7 +145,8 @@ ufo_zmq_pub_task_setup (UfoTask *task, static void ufo_zmq_pub_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { requisition->n_dims = 0; } diff --git a/src/ufo-zmq-sub-task.c b/src/ufo-zmq-sub-task.c index 1145272..5c8f7e5 100644 --- a/src/ufo-zmq-sub-task.c +++ b/src/ufo-zmq-sub-task.c @@ -170,7 +170,8 @@ request_data (UfoZmqSubTaskPrivate *priv) static void ufo_zmq_sub_task_get_requisition (UfoTask *task, UfoBuffer **inputs, - UfoRequisition *requisition) + UfoRequisition *requisition, + GError **error) { UfoZmqSubTaskPrivate *priv; zmq_msg_t htype_msg; @@ -178,7 +179,6 @@ ufo_zmq_sub_task_get_requisition (UfoTask *task, JsonParser *parser; JsonObject *object; JsonArray *array; - GError *error = NULL; priv = UFO_ZMQ_SUB_TASK_GET_PRIVATE (task); @@ -189,11 +189,8 @@ ufo_zmq_sub_task_get_requisition (UfoTask *task, zmq_msg_recv (&htype_msg, priv->socket, 0); header = zmq_msg_data (&htype_msg); parser = json_parser_new_immutable (); - json_parser_load_from_data (parser, header, zmq_msg_size (&htype_msg), &error); - if (error != NULL) { - g_error ("Error parsing JSON: %s", error->message); - g_error_free (error); + if (!json_parser_load_from_data (parser, header, zmq_msg_size (&htype_msg), error)) { g_object_unref (parser); return; } |