If I compare two pointers to the same variable, it seems to me that the two pointers should match. It has been too many years of not programming for me to be sure. I couldn’t find the function “gpiod_line_bulk_get_line” so I can’t really tell what pointer it is returning.
Alan > On Jul 27, 2023, at 7:23 AM, emc-developers-requ...@lists.sourceforge.net > wrote: > > Send Emc-developers mailing list submissions to > emc-developers@lists.sourceforge.net > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/emc-developers > or, via email, send a message with subject or body 'help' to > emc-developers-requ...@lists.sourceforge.net > > You can reach the person managing the list at > emc-developers-ow...@lists.sourceforge.net > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Emc-developers digest..." > > > Today's Topics: > > 1. gpiod - is it me or is it them? (andy pugh) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 27 Jul 2023 01:24:54 +0100 > From: andy pugh <bodge...@gmail.com> > To: EMC developers <emc-developers@lists.sourceforge.net> > Subject: [Emc-developers] gpiod - is it me or is it them? > Message-ID: > <CAN1+YZWOCe9yq88gJ8VgBU_oETDVRfBU7TX8=6AwycOnyD=b...@mail.gmail.com> > Content-Type: text/plain; charset="UTF-8" > > I think that I have found a mistake in gpiod > > https://github.com/brgl/libgpiod/blob/master/lib/core.c#L449 > > I think that this is comparing two pointers to the same struct. But > they won;t ever match as they are different variables? > > Or, alternatively, I don;t understand C and it is fine. > > Except it doesn't work.... > > printf("Chips line 0 %p %s\n", gpiod_line_get_chip(line0), > gpiod_chip_name(gpiod_line_get_chip(line0))); > printf("Chips line 1 %p %s\n", gpiod_line_get_chip(line1), > gpiod_chip_name(gpiod_line_get_chip(line1))); > printf("Chips line 2 %p %s\n", gpiod_line_get_chip(line2), > gpiod_chip_name(gpiod_line_get_chip(line2))); > > Returns: > > Chips line 0 0x3f1280 gpiochip0 > Chips line 1 0x3f2af0 gpiochip0 > Chips line 2 0x3f4350 gpiochip0 > > > > -- > atp > "A motorcycle is a bicycle with a pandemonium attachment and is > designed for the especial use of mechanical geniuses, daredevils and > lunatics." > ? George Fitch, Atlanta Constitution Newspaper, 1912 > > > > ------------------------------ > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers > > > ------------------------------ > > End of Emc-developers Digest, Vol 207, Issue 18 > *********************************************** _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers