Commit graph

25 commits

Author SHA1 Message Date
Nate Bargmann
3fa91c8771
Document fixing MinGW warnings and linker error
This commit has been left as documentation should these files be moved
to /doc or some such.  However, never of these files are built or
distributed.

----------------

From example.c the following warning was generated by MinGW:

  CC       example.o
example.c: In function ‘main’:
example.c:93:32: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘rmode_t’ {aka ‘long long unsigned int’} [-Wformat=]
   93 |     printf("Current mode = 0x%lX = %s, width = %ld\n", mode, rig_strrmode(mode),
      |                              ~~^                       ~~~~
      |                                |                       |
      |                                long unsigned int       rmode_t {aka long long unsigned int}
      |                              %llX

The 'l' was added as suggested to the format specifier but that resulted
in the following warning from Linux:

  CC       example.o
../../hamlib/tests/example.c:93:57: warning: format specifies type 'unsigned long long' but the argument has type 'rmode_t' (aka 'unsigned long') [-Wformat]
    printf("Current mode = 0x%llX = %s, width = %ld\n", mode, rig_strrmode(mode),
                             ~~~~                       ^~~~
                             %lX
  CC       rigctl-dumpcaps.o
1 warning generated.

So casting `mode` to `unsigned long long` quelled both warnings!

From testsecurity.c came this warning:

  CC       testsecurity-testsecurity.o
In file included from ../include/hamlib/rig.h:49,
                 from ../src/misc.h:26,
                 from testsecurity.c:29:
/usr/share/mingw-w64/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
   15 | #warning Please include winsock2.h before windows.h
      |  ^~~~~~~

Apparently winsock2.h being included through misc.h didn't work.

Finally, the Mingw linker gave the following error:

 CCLD     testsecurity.exe
/usr/bin/x86_64-w64-mingw32-ld: testsecurity-testsecurity.o: in function `main':
/home/nate/builds/hamlib-4.7~git/tests/testsecurity.c:97:(.text.startup+0x87): undefined reference to `AESStringCrypt'
/usr/bin/x86_64-w64-mingw32-ld: /home/nate/builds/hamlib-4.7~git/tests/testsecurity.c:116:(.text.startup+0x128): undefined reference to `AESStringDecrypt'
collect2: error: ld returned 1 exit status

Specifcally add the libsecurity.la file path as a specific library.
Even though the libhamlib.la seems to have the AESStringCrypt symbol
already.
2025-08-18 17:24:08 -05:00
Daniele Forsi IU5HKX
8d8d0328bf Fix typos 2025-08-03 10:49:23 +02:00
Daniele Forsi IU5HKX
0267068220 Fix ambiguity between system includes and Hamlib includes 2025-07-22 23:33:57 +02:00
George Baltz N3GB
1efaacb5ab Move port definition(s) to include/hamlib/port.h
Add some ghost structs and typedefs
Make example.c compile on gcc15 and with new includes
2025-07-10 09:54:03 -04:00
George Baltz N3GB
f15679f575 Update example.c
Avoid using raw rigport, in two different ways.
Fix variable name.
2024-01-14 18:13:05 -05:00
Michael Black W9MDB
c2cab54650 Change all FILPATHLEN names to HAMLIB_FILPATHLEN 2021-03-09 10:16:18 -06:00
Michael Black W9MDB
82126a4f09 Phase 1 of changing sprintflst functions to use buffer length
https://github.com/Hamlib/Hamlib/issues/580
2021-03-03 08:03:18 -06:00
Michael Black W9MDB
15958c8aab Fix parsing of SH command in newcat.c
Remove get_vfo from FT-891
https://github.com/Hamlib/Hamlib/issues/455
2020-12-06 22:54:47 -06:00
Michael Black W9MDB
1b2236bb2e Fix example.c to include rotator.h 2020-12-06 08:49:13 -06:00
Michael Black W9MDB
8e7586b3b2 Fix meade Autostart clause 2020-06-10 08:16:02 -05:00
Michael Black W9MDB
677ccac4bc astyle files 2020-05-27 12:23:08 -05:00
Michael Black W9MDB
87a83ffbb1 rigctld now works with rigctl in vfo mode
https://github.com/Hamlib/Hamlib/issues/259
set_vfo_opt can now dynamically change vfo mode on rigctld
So this example now works...does some non-vfo stuff then switches to vfo mode
rigctl -m 2 F 14074000 V VFOB F 14076000 V VFOA f V VFOB f set_vfo_opt 1 f VFOA
rigctl commands v,V and S have been changed to not require VFO arguments
New API function rig_set_vfo_opt -- only implemented for Net rigctl as it doesn't apply to any other rigs
2020-05-27 12:21:41 -05:00
mdblack98
67f7bd91e0 clean up example.c and it now does a reopen test at the end 2020-05-03 16:55:04 -05:00
mdblack98
ef1d42d2e1 Add rig_close test and clean up example.c 2020-05-03 16:10:07 -05:00
Michael Black
ff8ddf018c astyle all C files 2020-02-23 11:26:09 -06:00
Michael Black
776e21017b
Add rx_range example 2019-12-19 11:51:28 -06:00
Michael Black
f7399eb8df
Fix cppcheck warnings in example.c 2019-12-08 23:30:23 -06:00
Nate Bargmann
b692fb22ef Formatted tests/ to final coding guidelines 2017-10-06 18:58:42 -05:00
Nate Bargmann
d489b8bcb5 Apply formatting to 'tests/' directory
Format per style guide.
2017-08-10 05:46:12 -05:00
Nate Bargmann
1229a0a42a Assure NULL terminated strings in tests programs.
Various strncpy operations could result in a port pathname that is not a
NULL terminated string as the allowed string length is the same size as
the buffer per the strncpy manual page.  This is corrected by assuring
that the allowed length is FILPATHLEN - 1.
2012-01-07 20:36:50 -06:00
Martin Ewing, AA6E
0cc33fb486 Example updates
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2553 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-04 01:27:43 +00:00
Martin Ewing, AA6E
5af5c82996 use rawstrength.i which matters in PPC compile
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2545 7ae35d74-ebe9-4afe-98af-79ac388436b8
2009-01-02 03:51:40 +00:00
Martin Ewing, AA6E
b2def3a225 Add S meter operations to sample program.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2249 7ae35d74-ebe9-4afe-98af-79ac388436b8
2007-11-23 04:50:18 +00:00
Martin Ewing, AA6E
1b6b861e6c Add more functions to example program.
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2237 7ae35d74-ebe9-4afe-98af-79ac388436b8
2007-11-09 03:14:39 +00:00
Martin Ewing, AA6E
30bb34efa5 Dead simple sample Hamlib program
git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2214 7ae35d74-ebe9-4afe-98af-79ac388436b8
2007-09-04 21:53:40 +00:00