[aravis] Re: Evaluator problem

  • From: <tom.cobb@xxxxxxxxxxxxx>
  • To: <aravis@xxxxxxxxxxxxx>
  • Date: Wed, 1 Aug 2012 14:43:16 +0000

Ok, found the problem, but need help with the solution:

--- src/arvevaluator.c  (revision 80561)
+++ src/arvevaluator.c  (working copy)
@@ -888,7 +888,7 @@
                                        status = 
ARV_EVALUATOR_STATUS_PARENTHESES_MISMATCH;
                                        goto CLEANUP;
                                }
-                               arv_evaluator_token_free (token);
+                               //arv_evaluator_token_free (token);
                                arv_evaluator_token_free (operator_stack->data);
                                operator_stack = g_slist_delete_link 
(operator_stack, operator_stack);
                        } else {

This arv_evaluator_token_free is freeing token, which is passed (as 
previous_token) to arv_get_next_token. This causes 
arv_evaluator_token_is_right_parenthesis(previous_token) to return False, which 
causes "+" to be interpreted as a unary plus instead of a binary plus, causing 
our remaining operands error. There is a similar arv_evaluator_token_free in 
the code dealing with ",". Not quite sure where we should free this token, but 
I guess it needs to be delayed!

Thanks,
Tom

> -----Original Message-----
> From: aravis-bounce@xxxxxxxxxxxxx [mailto:aravis-bounce@xxxxxxxxxxxxx]
> On Behalf Of tom.cobb@xxxxxxxxxxxxx
> Sent: 01 August 2012 14:11
> To: aravis@xxxxxxxxxxxxx
> Subject: [aravis] Evaluator problem
> 
> Hi,
> 
> I've been trying out a new camera, and I get an error from
> arv_evaluator:
> 
> [Evaluator::evaluate_as_int64] Expression = '(BINNING &
> 0x00060000)=0?((TO & 0xFF)+1):1'
> (BINNING & 0x00060000)=0?((TO & 0xFF)+1):1
> [Evaluator::evaluate_as_int64] Parsing status = 0
> (var) BINNING = 0
> (int64) 393216
> (operator) &
> (int64) 0
> (operator) =
> (var) TO = 0
> (int64) 255
> (operator) &
> (int64) 1
> (operator) plus
> (int64) 1
> (operator) :
> (operator) ?
> [Evaluator::evaluate] Error 'remaining operands'
> 
> Any idea what's going on here?
> 
> Thanks,
> Tom
> 
> 
> --
> This e-mail and any attachments may contain confidential, copyright and
> or privileged material, and are for the use of the intended addressee
> only. If you are not the intended addressee or an authorised recipient
> of the addressee please notify us of receipt by returning the e-mail
> and do not use, copy, retain, distribute or disclose the information in
> or attached to the e-mail.
> Any opinions expressed within this e-mail are those of the individual
> and not necessarily of Diamond Light Source Ltd.
> Diamond Light Source Ltd. cannot guarantee that this e-mail or any
> attachments are free from viruses and we cannot accept liability for
> any damage which you may sustain as a result of software viruses which
> may be transmitted in or with the message.
> Diamond Light Source Limited (company no. 4375679). Registered in
> England and Wales with its registered office at Diamond House, Harwell
> Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United
> Kingdom
> 
> 
> 
> 


--
This e-mail and any attachments may contain confidential, copyright and or 
privileged material, and are for the use of the intended addressee only. If you 
are not the intended addressee or an authorised recipient of the addressee 
please notify us of receipt by returning the e-mail and do not use, copy, 
retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not 
necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments 
are free from viruses and we cannot accept liability for any damage which you 
may sustain as a result of software viruses which may be transmitted in or with 
the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and 
Wales with its registered office at Diamond House, Harwell Science and 
Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom





Other related posts: