Commit Graph
24 Commits
Author SHA1 Message Date
Linus Yang 2ed8791dab Re-add support for MinGW 2018-03-08 17:26:11 +08:00
Max Lv fbd34516f0 Update json.c and fix #1594 2017-07-28 22:55:23 +08:00
Syrone Wong baff29e970 Fix issues found by cppcheck
- GNU treats void* as char* when doing pointer arithmetic, so let's make it clear
- Fix memory leak, save copy from malloc() and pass the original pointer to free()
- minor type mismatches

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-12-07 22:30:47 -06:00
Syrone Wong 43a236d3ca Clarify calculation precedence for '&' and '?' (#986) 2016-12-07 20:05:36 -06:00
Max Lv efafb59647 Fix #863 2016-10-02 13:37:45 +08:00
Max Lv b28638ab80 Clean up 2016-09-09 13:17:58 +08:00
Max Lv 8701f1dc65 Add missing headers 2016-04-16 01:02:12 +08:00
Max Lv 2363acf1f7 Fix a typo 2016-04-16 00:58:13 +08:00
Syrone Wong ebe79bbbd8 Refine memory management (#579)
- Added one macro to avoid dangling pointers
- Added two functions to perform NULL pointer check
  since the allocation is not guaranteed by C library, although it
  is a rare case, just for sanity
- Add NULL pointer check to brealloc() and bfree() and for sanity as well

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-04-15 09:16:38 -07:00
Syrone Wong 58264c77fc Polish code
code issues found by Clang with
CFLAGS="-Os -Wall -Wextra -Werror=unused-const-variable -Wno-error=unused-parameter"
enabled

The details as follows:
- variable initialization issue, modified them as Clang suggested
- data type mismatch when comparing, fix them either by casting or changing
  the data type of index of iterator
- get_sockaddr() in netutils may return -1 thus changed returning type from
  size_t to ssize_t, which makes Clang happier
- recvfrom() in udprelay is identical, fix this by creating local variable
  for comparison  and assign back to buf->len when returning value is acceptable

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-04-07 21:28:23 -07:00
Max Lv b0600a8784 Refine buffer handling 2015-11-30 15:03:04 +08:00
Max Lv 2a15e97196 bump version 2015-01-07 21:54:19 +09:00
Max Lv b198d1da2e bump version 2014-11-12 13:12:59 +08:00
Max Lv 08a35fd1bb handle sigterm and sigkill 2014-11-12 11:52:34 +08:00
Max Lv fa2acecd62 clean up 2014-04-16 10:44:15 +08:00
Max Lv 39a52da457 use size_t instead 2014-04-04 09:13:30 +08:00
William Wong 1948330bc2 Fix a compile error with mingw64
Fix an error below.

json.c:135:42: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
                   (state, values_size + ((unsigned long) value->u.object.values), 0)) )
                                          ^
2014-04-03 15:11:31 +08:00
Max Lv 2b92b57bed fix the ambiguous type defination 2014-02-27 08:11:16 +08:00
Max Lv 7063d1fa6f update json-parser 2014-02-21 19:18:14 +08:00
Max Lv b0bcda7a3e fix compile issues in cygwin 2014-01-06 12:47:59 +08:00
Max Lv 6663ebb70a fix some warnings 2014-01-05 11:22:43 +00:00
Max Lv d227da2323 Update code style 2013-09-05 09:29:43 +08:00
Max Lv c06c1495fb fix json format issue 2013-04-23 10:39:09 +08:00
Max Lv e2efa22733 embedded libev 2013-04-01 17:56:39 +08:00