Commit Graph

10 Commits

Author SHA1 Message Date
Rosen Penev
fc9ca6c71a clang-tidy: do not use else after return
Found with readability-else-after-return

Easier to read.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-04-11 07:49:21 +01:00
Uri Lublin
21323c8b6f glz_dictionary_window_add_image: error out when failed to alloc an image
__glz_dictionary_window_alloc_image may return NULL.
Check that the image was created successfully and if not
then error out using dict->cur_usr->error like it's done
few lines below.

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-06-17 12:53:22 +01:00
Uri Lublin
031ab732dd glz_enc_dictionary_restore: return NULL upon failure
glz_enc_dictionary_create may return NULL.
glz_enc_dictionary_restore itself may return NULL so
add one more check.

Found-by: gcc (10) analyzer

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-06-17 12:53:19 +01:00
Uri Lublin
c964ca4040 typo: fix the spelling of precede
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-07-04 10:05:19 +01:00
Frediano Ziglio
ed68d491fd Do not check for HAVE_CONFIG_H
This should always be defined and including config.h is a requirement.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-30 09:26:55 +01:00
Frediano Ziglio
c778c7ce93 glz-encoder-dict: Remove a warning compiling with CentOS 7
CentOS 7 compiler generate this warning:

glz-encoder-dict.c: In function 'glz_dictionary_pre_encode':
glz-encoder-dict.c:516:30: error: 'prev_seg_id' may be used uninitialized in this function [-Werror=maybe-uninitialized]
             dict->window.segs[prev_seg_id].next = seg_id;
                              ^
glz-encoder-dict.c:492:22: note: 'prev_seg_id' was declared here
     uint32_t seg_id, prev_seg_id;
                      ^

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-07-11 10:22:36 +01:00
Christophe Fergeau
78c3dd4c18 Make various functions static
- glz_enc_dictionary_reset
- monitors_config_new
- red_channel_any_blocked
- red_channel_no_item_being_sent
- red_client_get_channel

are only used in the file where they are defined, so they can as well be
static.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-04-05 12:39:20 +02:00
Christophe Fergeau
6377b72d44 Use bool rather than int return values when appropriate
This commit changes all functions returning TRUE/FALSE from having an
'int' return value to 'bool'.
This way it's obvious that such a function is not going to return
anything else than TRUE or FALSE.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-09 18:39:29 +01:00
Jonathon Jongsma
0410c6f165 remove glz_encoder_config.h
Move all code from glz_encoder_config.h into other files.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-12-04 11:57:18 +00:00
Frediano Ziglio
525cd67be7 server: rename files
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-03 23:54:32 +00:00