-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various fixes from SCA #157
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
dalgaaf
commented
May 30, 2018
- size() vs empty()
- init in ctor init list
- signed/unsigned checks
- unused vars
- fix compiler warnings
- update gitignore
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <[email protected]>
Signed-off-by: Danny Al-Gaaf <[email protected]>
Signed-off-by: Danny Al-Gaaf <[email protected]>
Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf <[email protected]>
Signed-off-by: Danny Al-Gaaf <[email protected]>
rmb.cpp:296:8: warning: unused variable ‘debug’ [-Wunused-variable] Signed-off-by: Danny Al-Gaaf <[email protected]>
Do not use unsigned uid parameter to transport extra information by assigning -1 to it. Use a separate bool paramter for that. Fix for: rbox-sync-rebuild.cpp: In function ‘int rbox_sync_add_object(index_rebuild_context*, const string&, librmb::RadosMailObject*, bool, uint32_t)’: rbox-sync-rebuild.cpp:47:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (uid == -1) { ~~~~^~~~~ Signed-off-by: Danny Al-Gaaf <[email protected]>
Signed-off-by: Danny Al-Gaaf <[email protected]>
rbox-sync-rebuild.cpp:84:17: warning: declaration of ‘oid’ shadows a previous local [-Wshadow] std::string oid = mail_obj->get_oid(); ^~~ rbox-sync-rebuild.cpp:60:14: note: shadowed declaration is here guid_128_t oid; ^~~ Signed-off-by: Danny Al-Gaaf <[email protected]>
rbox-sync-rebuild.cpp:87:71: warning: comparison of constant ‘0’ with boolean expression is always false [-Wbool-compare] if (r_storage->ms->get_storage()->update_metadata(oid, to_update) < 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ Signed-off-by: Danny Al-Gaaf <[email protected]>
rbox-sync-rebuild.cpp: In function ‘int rbox_sync_rebuild_entry(index_rebuild_context*, librados::NObjectIterator&, bool, bool)’: rbox-sync-rebuild.cpp:96:5: warning: no previous declaration for ‘int rbox_sync_rebuild_entry(index_rebuild_context*, librados::NObjectIterator&, bool, bool)’ [-Wmissing-declarations] int rbox_sync_rebuild_entry(struct index_rebuild_context *ctx, librados::NObjectIterator &iter, bool alt_storage, ^~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Danny Al-Gaaf <[email protected]>
rbox-storage.cpp: In function ‘int read_plugin_configuration(mailbox*)’: rbox-storage.cpp:356:110: warning: too many arguments for format [-Wformat-extra-args] i_warning("unable to open the rados save log file ", storage->config->get_rados_save_log_file().c_str()); Signed-off-by: Danny Al-Gaaf <[email protected]>
rbox-copy.cpp: In function ‘int rbox_mail_storage_try_copy(mail_save_context**, mail*, bool)’: rbox-copy.cpp:228:43: warning: format ‘%s’ expects argument of type ‘char*’, but argument 7 has type ‘std::__cxx11::string* {aka std::__cxx11::basic_string<char>*}’ [-Wformat=] rados_storage->get_pool_name()); Signed-off-by: Danny Al-Gaaf <[email protected]>
Signed-off-by: Danny Al-Gaaf <[email protected]>
Signed-off-by: Danny Al-Gaaf <[email protected]>
Travis CI: some docker commands failed |
travis ci had some network issues (connection timeout). I restarted the builds. |
rbox-save.cpp:104:24: warning: unused variable ‘r_storage’ [-Wunused-variable] struct rbox_storage *r_storage = (struct rbox_storage *)&r_ctx->mbox->storage->storage; ^~~~~~~~~ Signed-off-by: Danny Al-Gaaf <[email protected]>
librmb/test_librmb_utils.cpp: In function ‘void* write_to_save_file(void*)’: librmb/test_librmb_utils.cpp:189:7: warning: function might be candidate for attribute ‘noreturn’ [-Wsuggest-attribute=noreturn] void *write_to_save_file(void *threadid) { ^~~~~~~~~~~~~~~~~~ Signed-off-by: Danny Al-Gaaf <[email protected]>
librmb/test_librmb_utils.cpp: In member function ‘virtual void librmb_append_to_existing_file_multi_threading_Test::TestBody()’: librmb/test_librmb_utils.cpp:212:72: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] rc = pthread_create(&threads[i], NULL, write_to_save_file, (void *)i); ^ Signed-off-by: Danny Al-Gaaf <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.