1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00
Commit Graph

20 Commits

Author SHA1 Message Date
Sam James
51b2a621b3 Fix -Wcalloc-transposed-args
Fixes warnings like:
```
unittest/libmariadb/bulk1.c: In function ‘bulk1’:
unittest/libmariadb/bulk1.c:77:43: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
   77 |   lengths= (unsigned long *)calloc(sizeof(long), TEST_ARRAY_SIZE);
      |                                           ^~~~
unittest/libmariadb/bulk1.c:77:43: note: earlier argument should specify number of elements, later size of each element
unittest/libmariadb/bulk1.c:78:39: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argu
ment and not in the later argument [-Werror=calloc-transposed-args]
   78 |   vals= (unsigned int *)calloc(sizeof(int), TEST_ARRAY_SIZE);
      |                                       ^~~
```

The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```

So, just swap the number of members and size arguments to match the
prototype, as we're initialising N struct of size Y. GCC then sees we're not
doing anything wrong.

Signed-off-by: Sam James <sam@gentoo.org>
2024-04-29 14:16:15 +02:00
Georg Richter
1fed6c3184 Build fix:
declared deinit function of plugins as deinit(void) instead
of deinit().
2020-10-21 07:23:50 +02:00
Vladislav Vaintroub
c0837c3b8d MDEV-21612 Remove COM_MULTI.
The server command code 254 is now reserved,
as well as corresponding protocol flag.

Do not reuse them.
2020-09-22 17:26:04 +02:00
Oleksandr Byelkin
895dcb61e3 C preprocessor defines fix 2020-06-04 16:49:21 +02:00
Georg Richter
326e719f0c Removed strndup from trace-example (not available on all platforms) 2016-11-29 18:22:38 +01:00
Georg Richter
aabaac04aa Plugin fixes
- include ma_errmsg.h if plugin is built dynamically
- trace_example fixes
2016-11-24 08:56:27 +01:00
Georg Richter
9f88e25fd6 Compiler warning fixes 2016-09-03 12:46:50 +02:00
Georg Richter
45a635dead Fixed compiler warnings
removed latest test for ssl threads (test.c)
2016-06-29 15:22:01 +02:00
Georg Richter
d68b48f954 10.2 integration fixes
- changed plugin API to avoid crashes: Oracle/MariaDB changed
    structure several times without updating interface version.
  - ABI fixes: moved additional net items to net->extension (connection
    handler and com_multi buffer)
2016-02-22 11:37:13 +01:00
Georg Richter
4ca933bb81 Global cleanup:
removed global locks
  removed dead code and files
  removed dbug
2016-02-08 18:43:02 +01:00
Georg Richter
72f7c4abf5 Windows 64-bit fixes:
changed type of length parameter in mysql_stmt_prepare,
mysql_real_query, mysql_stmt_send_long_data (incl. async _start
functions) from unsigned long to size_t.
Fixed warnings
2015-11-05 11:52:50 +01:00
Georg Richter
dd29c4abec Renamed MYSQL_COM_* to COM_
changed default schema for tests to test_c
2015-11-02 15:19:10 +01:00
Georg Richter
c40b675bf3 Fixed trace_example compiler warnings 2015-10-30 19:16:17 +01:00
Georg Richter
7500f37150 - Renamed cio to pvio (pluggable virtual IO)
- minor fixes in windows schannel
2015-10-27 10:24:48 +01:00
Georg Richter
5827c04551 Windows build fixes 2015-10-19 09:52:30 +02:00
Georg Richter
ba301da127 Fixed windows build 2015-10-05 08:06:48 +02:00
Georg Richter
05659c872e More plugin configuration changes (last commit was incomplete) 2015-10-02 10:09:41 +02:00
Georg Richter
4597cd6a80 Various ssl and schannel fixes 2015-09-10 17:16:21 +02:00
Georg Richter
f2955a4b39 more fixes 2015-08-10 12:09:14 +02:00
Georg Richter
cc85e25666 Added missing cio components 2015-08-06 15:08:25 +02:00