William R. Elliot
2024-Oct-22 03:00 UTC
[Nut-upsdev] Why only the first of a series of calls to a function in my driver executing?
Hello all, In my new driver I have a function that searches for the position of a known substring in a delimited string. I am trying to populate a series of integer variables with the position value of various substrings. The first call to the function performs correctly but the remaining calls in the code series are not being executed (there are six more calls after the first successful one). Any ideas why only the first call is being done? Similarly, I have another function that takes a position variable and pulls the data in the nth position from a delimited string. There is also a series of these called in a row and only the first is being called. Any ideas on what to look for would be appreciated. Thanks, Bill -- This email has been checked for viruses by AVG antivirus software. www.avg.com
Jim Klimov
2024-Oct-22 07:41 UTC
[Nut-upsdev] Why only the first of a series of calls to a function in my driver executing?
Hello, always nice to hear about new drivers :) OTOH, check for any variables you might have been re-using, so their earlier state impacts later runs - whether buffers allocated statically (or by caller without rewinding the pointer and maybe nulling the contents), or position counters, etc. Similarly, be sure to pre-initialize anything of value and not start out with random bits from the stack. Also if it is about a series of calls - are there some (loop?) conditions between the calls that might just preclude them from being called in the first place? Old-school tracing with debug printouts is good in very many cases; otherwise it can really help to stage a run in an IDE with a debugger. Cross-platform wise, I've had consistently good experience with NetBeans (installing the C/C++ plugin from the NB 8.2 archive after every NB upgrade is a PITA though); VSCode also worked (at least when I drilled into NUT for Windows builds with MSYS2) - hints on both are in NUT docs. Hope this helps, Jim Klimov On Tue, Oct 22, 2024 at 5:01?AM William R. Elliot <bill at wreassoc.com> wrote:> Hello all, > > In my new driver I have a function that searches for the position of > a known substring in a delimited string. I am trying to populate a > series of integer variables with the position value of various > substrings. The first call to the function performs correctly but the > remaining calls in the code series are not being executed (there are > six more calls after the first successful one). Any ideas why only > the first call is being done? > > Similarly, I have another function that takes a position variable and > pulls the data in the nth position from a delimited string. There is > also a series of these called in a row and only the first is being called. > > Any ideas on what to look for would be appreciated. > > Thanks, > > Bill > > > > -- > This email has been checked for viruses by AVG antivirus software. > www.avg.com > > _______________________________________________ > Nut-upsdev mailing list > Nut-upsdev at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsdev/attachments/20241022/1ca4bf67/attachment.htm>
Reasonably Related Threads
- Why only the first of a series of calls to a function in my driver executing?
- Why only the first of a series of calls to a function in my driver executing?
- NUT driver update process...
- Getting the NUT pieces to work together...
- Formalize use of the FSD flag (was: NUT driver update process...)