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


_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to