1
0
mirror of git://sigrok.org/libserialport synced 2023-08-10 21:13:24 +03:00
Commit Graph

18 Commits

Author SHA1 Message Date
Uwe Hermann
613c48f191 Fix a compiler warning when -Wshadow is used.
CC       serialport.lo
  In file included from ../serialport.c:25:0:
  ../serialport.c: In function 'get_config':
  ../libserialport_internal.h:227:25: warning: declaration of 'ret' shadows a previous local [-Wshadow]
   #define TRY(x) do { int ret = x; if (ret != SP_OK) RETURN_CODEVAL(ret); } while (0)
                           ^
  ../serialport.c:1566:3: note: in expansion of macro 'TRY'
     TRY(get_baudrate(port->fd, &config->baudrate));
     ^
  ../serialport.c:1543:6: warning: shadowed declaration is here [-Wshadow]
    int ret = get_flow(port->fd, data);
        ^

Also, add -Wshadow to the list of default compiler options.
2015-04-18 21:54:42 +02:00
Uwe Hermann
e019e72ec0 Fix a compiler warning.
This fixes the following scan-build warning:

  serialport.c: In function 'sp_list_ports':
  serialport.c:354:1: warning: control reaches end of non-void function [-Wreturn-type]
2015-04-03 20:50:22 +02:00
Uwe Hermann
b344a40bb2 Fix indentation of a switch(). 2015-04-03 17:51:47 +02:00
Martin Ling
47fcf8ec85 windows: Revise management of WaitCommEvent() operations.
This fixes (at least parts of) bug #341.
2015-03-29 22:18:46 +02:00
Uwe Hermann
6c6aebe78c Make std_baudrates[] static (only used in one file). 2015-03-26 23:57:56 +01:00
Uwe Hermann
dc422c04af Various cosmetic and consistency fixes. 2015-03-26 23:57:56 +01:00
Uwe Hermann
2b40f81454 libserialport_internal.h: Add #include guard. 2015-03-26 23:57:56 +01:00
Martin Ling
7c081505e5 Generate a config.h rather than passing defines on command line.
Fixes bug #553.
2015-03-24 23:15:32 +00:00
Martin Ling
59182fbbbf linux: Check for BOTHER macro at configure time.
This fixes bug #363.
2014-11-01 18:36:09 +01:00
Martin Ling
78940e6921 windows: Fix compile issues with multiply or not defined GUIDs.
This fixes bug #416.
2014-09-25 23:04:06 +02:00
Michael B. Trausch
d179da05c0 windows: Include proper GUID defining header to fix build.
The initguid.h header must appear early or it does not have
an effect, at least on cross-build from Linux.
2014-09-07 18:51:04 +02:00
Aurelien Jacobs
653cef3ab1 linux: remove readlinkat() dependency 2014-09-04 20:13:55 +02:00
Martin Ling
c51b846eee linux: Define feature macros to get required functions.
This is needed to build with -std=c99.
2014-08-24 14:06:21 +01:00
Martin Ling
7890cef6cf Revise debug macros to work in strict C99. 2014-08-24 14:06:21 +01:00
Martin Ling
9caa2e86aa Specialise RETURN_VALUE macro into RETURN_{INT,STRING,POINTER}.
This avoids the need to pass the required format string on every
call and also eliminates the need for the non-standard typeof() call.
2014-08-24 13:31:20 +01:00
Aurelien Jacobs
970f279ae4 Introduce SP_API/SP_PRIV to mark visibility of functions. 2014-07-02 14:43:32 +02:00
Aurelien Jacobs
48a4076f69 Move list_ports() implementations to OS-specific files. 2014-06-14 01:28:49 +02:00
Martin Ling
e33dcf90a0 Tidy up and split most OS-specific code to separate files. 2014-06-11 15:10:29 +01:00