Summary: rde: Fix cpplint warnings [#1871] Review request for Trac Ticket(s): 1871 Peer Reviewer(s): Ramesh Pull request to: Affected branch(es): default(5.1) Development branch: default
-------------------------------- Impacted area Impact y/n -------------------------------- Docs n Build system n RPM/packaging n Configuration files n Startup scripts n SAF services n OpenSAF services y Core libraries n Samples n Tests n Other n Comments (indicate scope for each "y" above): --------------------------------------------- changeset 4d8e6e2910edf603eab775205854f65013b733ca Author: Anders Widell <[email protected]> Date: Thu, 09 Jun 2016 16:13:58 +0200 base: Change ncs_task_create() parameter from char* to const char* [#1871] To avoid const_cast<char*>() in C++ code, the ncs_task_create() function signature has been updated to take a pointer to const char*. changeset 099523254e10baa7933bf8b0c79f32208fd06537 Author: Anders Widell <[email protected]> Date: Thu, 09 Jun 2016 16:14:03 +0200 rde: Fix cpplint warnings [#1871] The following cpplint warnings have been fixed: osaf/libs/core/include/rda_papi.h:30: #ifndef header guard has wrong style, please use: OSAF_LIBS_CORE_INCLUDE_RDA_PAPI_H_ [build/header_guard] [5] osaf/libs/core/include/rda_papi.h:141: #endif line should be "#endif // OSAF_LIBS_CORE_INCLUDE_RDA_PAPI_H_" [build/header_guard] [5] osaf/libs/core/include/rda_papi.h:38: Include the directory when naming .h files [build/include] [4] Done processing osaf/libs/core/include/rda_papi.h osaf/libs/agents/infrastructure/rda/rda.h:30: #ifndef header guard has wrong style, please use: OSAF_LIBS_AGENTS_INFRASTRUCTURE_RDA_RDA_H_ [build/header_guard] [5] osaf/libs/agents/infrastructure/rda/rda.h:85: #endif line should be "#endif // OSAF_LIBS_AGENTS_INFRASTRUCTURE_RDA_RDA_H_" [build/header_guard] [5] osaf/libs/agents/infrastructure/rda/rda.h:37: Found C system header after C++ system header. Should be: rda.h, c system, c++ system, other. [build/include_order] [4] osaf/libs/agents/infrastructure/rda/rda.h:39: Found C system header after C++ system header. Should be: rda.h, c system, c++ system, other. [build/include_order] [4] osaf/libs/agents/infrastructure/rda/rda.h:40: Found C system header after C++ system header. Should be: rda.h, c system, c++ system, other. [build/include_order] [4] osaf/libs/agents/infrastructure/rda/rda.h:41: Found C system header after C++ system header. Should be: rda.h, c system, c++ system, other. [build/include_order] [4] osaf/libs/agents/infrastructure/rda/rda.h:42: Found C system header after C++ system header. Should be: rda.h, c system, c++ system, other. [build/include_order] [4] osaf/libs/agents/infrastructure/rda/rda.h:43: Found C system header after C++ system header. Should be: rda.h, c system, c++ system, other. [build/include_order] [4] osaf/libs/agents/infrastructure/rda/rda.h:45: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:46: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:48: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:49: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:50: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:51: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:52: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:53: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:54: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:55: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:56: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:57: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:58: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:60: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:61: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:61: "ncssysf_lck.h" already included at osaf/libs/agents/infrastructure/rda/rda.h:50 [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:62: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:67: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda.h:68: Include the directory when naming .h files [build/include] [4] Done processing osaf/libs/agents/infrastructure/rda/rda.h osaf/libs/agents/infrastructure/rda/rda_papi.cc:35: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda_papi.cc:36: Found C++ system header after other header. Should be: rda_papi.h, c system, c++ system, other. [build/include_order] [4] osaf/libs/agents/infrastructure/rda/rda_papi.cc:37: Found C++ system header after other header. Should be: rda_papi.h, c system, c++ system, other. [build/include_order] [4] osaf/libs/agents/infrastructure/rda/rda_papi.cc:38: Found C system header after other header. Should be: rda_papi.h, c system, c++ system, other. [build/include_order] [4] osaf/libs/agents/infrastructure/rda/rda_papi.cc:39: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda_papi.cc:40: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda_papi.cc:41: Include the directory when naming .h files [build/include] [4] osaf/libs/agents/infrastructure/rda/rda_papi.cc:197: Use int16/int64/etc, rather than the C type long [runtime/int] [4] osaf/libs/agents/infrastructure/rda/rda_papi.cc:248: Extra space before ) [whitespace/parens] [2] osaf/libs/agents/infrastructure/rda/rda_papi.cc:248: Using C-style cast. Use const_cast<char * >(...) instead [readability/casting] [4] osaf/libs/agents/infrastructure/rda/rda_papi.cc:364: Never use sprintf. Use snprintf instead. [runtime/printf] [5] osaf/libs/agents/infrastructure/rda/rda_papi.cc:428: Never use sprintf. Use snprintf instead. [runtime/printf] [5] osaf/libs/agents/infrastructure/rda/rda_papi.cc:552: Never use sprintf. Use snprintf instead. [runtime/printf] [5] osaf/libs/agents/infrastructure/rda/rda_papi.cc:589: Never use sprintf. Use snprintf instead. [runtime/printf] [5] osaf/libs/agents/infrastructure/rda/rda_papi.cc:723: Almost always, snprintf is better than strcpy [runtime/printf] [4] Done processing osaf/libs/agents/infrastructure/rda/rda_papi.cc osaf/services/infrastructure/rde/rde_amf.cc:18: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/rde_amf.cc:23: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/rde_amf.cc:24: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/rde_amf.cc:115: Using C-style cast. Use reinterpret_cast<char*>(...) instead [readability/casting] [4] osaf/services/infrastructure/rde/rde_amf.cc:115: Almost always, snprintf is better than strcpy [runtime/printf] [4] osaf/services/infrastructure/rde/rde_amf.cc:124: Almost always, snprintf is better than strcpy [runtime/printf] [4] osaf/services/infrastructure/rde/rde_amf.cc:126: Almost always, snprintf is better than strcpy [runtime/printf] [4] osaf/services/infrastructure/rde/rde_amf.cc:128: Using C-style cast. Use reinterpret_cast<char*>(...) instead [readability/casting] [4] osaf/services/infrastructure/rde/rde_amf.cc:128: Almost always, snprintf is better than strcpy [runtime/printf] [4] osaf/services/infrastructure/rde/rde_amf.cc:129: Using C-style cast. Use reinterpret_cast<char*>(...) instead [readability/casting] [4] osaf/services/infrastructure/rde/rde_amf.cc:178: Using C-style cast. Use reinterpret_cast<char*>(...) instead [readability/casting] [4] osaf/services/infrastructure/rde/rde_amf.cc:178: Almost always, snprintf is better than strcpy [runtime/printf] [4] osaf/services/infrastructure/rde/rde_amf.cc:188: Using C-style cast. Use reinterpret_cast<SaNameT*>(...) instead [readability/casting] [4] Done processing osaf/services/infrastructure/rde/rde_amf.cc osaf/services/infrastructure/rde/rde_rda.cc:40: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/rde_rda.cc:41: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/rde_rda.cc:233: Never use sprintf. Use snprintf instead. [runtime/printf] [5] osaf/services/infrastructure/rde/rde_rda.cc:263: Never use sprintf. Use snprintf instead. [runtime/printf] [5] osaf/services/infrastructure/rde/rde_rda.cc:300: Never use sprintf. Use snprintf instead. [runtime/printf] [5] osaf/services/infrastructure/rde/rde_rda.cc:302: Never use sprintf. Use snprintf instead. [runtime/printf] [5] osaf/services/infrastructure/rde/rde_rda.cc:343: Never use sprintf. Use snprintf instead. [runtime/printf] [5] osaf/services/infrastructure/rde/rde_rda.cc:495: Line contains only semicolon. If this should be an empty statement, use {} instead. [whitespace/semicolon] [5] osaf/services/infrastructure/rde/rde_rda.cc:499: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] osaf/services/infrastructure/rde/rde_rda.cc:530: Never use sprintf. Use snprintf instead. [runtime/printf] [5] Done processing osaf/services/infrastructure/rde/rde_rda.cc osaf/services/infrastructure/rde/rde_mds.cc:18: <thread> is an unapproved C++11 header. [build/c++11] [5] osaf/services/infrastructure/rde/rde_mds.cc:19: <chrono> is an unapproved C++11 header. [build/c++11] [5] osaf/services/infrastructure/rde/rde_mds.cc:20: Found C system header after C++ system header. Should be: rde_mds.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_mds.cc:21: Found C system header after C++ system header. Should be: rde_mds.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_mds.cc:22: Found C system header after C++ system header. Should be: rde_mds.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_mds.cc:24: Found C system header after C++ system header. Should be: rde_mds.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_mds.cc:117: Using C-style cast. Use reinterpret_cast<NCS_IPC_MSG*>(...) instead [readability/casting] [4] osaf/services/infrastructure/rde/rde_mds.cc:150: Using C-style cast. Use reinterpret_cast<NCS_IPC_MSG*>(...) instead [readability/casting] [4] osaf/services/infrastructure/rde/rde_mds.cc:209: Complex multi-line /*...*/-style comment found. Lint may give bogus warnings. Consider replacing these with //-style comments, with #if 0...#endif, or with more clearly structured multi-line comments. [readability/multiline_comment] [5] Done processing osaf/services/infrastructure/rde/rde_mds.cc osaf/services/infrastructure/rde/rde_main.cc:21: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:22: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:25: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:26: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:27: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:28: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:29: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:30: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:32: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:33: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:34: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:35: Found C system header after C++ system header. Should be: rde_main.h, c system, c++ system, other. [build/include_order] [4] osaf/services/infrastructure/rde/rde_main.cc:36: "nid_api.h" already included at osaf/services/infrastructure/rde/rde_main.cc:34 [build/include] [4] osaf/services/infrastructure/rde/rde_main.cc:38: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/rde_main.cc:39: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/rde_main.cc:40: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/rde_main.cc:41: Include the directory when naming .h files [build/include] [4] Done processing osaf/services/infrastructure/rde/rde_main.cc osaf/services/infrastructure/rde/role.cc:21: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/role.cc:23: <chrono> is an unapproved C++11 header. [build/c++11] [5] osaf/services/infrastructure/rde/role.cc:24: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/role.cc:25: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/role.cc:26: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/role.cc:30: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/role.cc:102: Else clause should never be on same line as else (use 2 lines) [whitespace/newline] [4] Done processing osaf/services/infrastructure/rde/role.cc osaf/services/infrastructure/rde/include/rde_cb.h:18: #ifndef header guard has wrong style, please use: OSAF_SERVICES_INFRASTRUCTURE_RDE_INCLUDE_RDE_CB_H_ [build/header_guard] [5] osaf/services/infrastructure/rde/include/rde_cb.h:88: #endif line should be "#endif // OSAF_SERVICES_INFRASTRUCTURE_RDE_INCLUDE_RDE_CB_H_" [build/header_guard] [5] osaf/services/infrastructure/rde/include/rde_cb.h:24: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/include/rde_cb.h:25: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/include/rde_cb.h:26: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/include/rde_cb.h:27: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/include/rde_cb.h:28: Include the directory when naming .h files [build/include] [4] Done processing osaf/services/infrastructure/rde/include/rde_cb.h osaf/services/infrastructure/rde/include/rde_rda_common.h:30: #ifndef header guard has wrong style, please use: OSAF_SERVICES_INFRASTRUCTURE_RDE_INCLUDE_RDE_RDA_COMMON_H_ [build/header_guard] [5] osaf/services/infrastructure/rde/include/rde_rda_common.h:69: #endif line should be "#endif // OSAF_SERVICES_INFRASTRUCTURE_RDE_INCLUDE_RDE_RDA_COMMON_H_" [build/header_guard] [5] Done processing osaf/services/infrastructure/rde/include/rde_rda_common.h osaf/services/infrastructure/rde/include/role.h:18: #ifndef header guard has wrong style, please use: OSAF_SERVICES_INFRASTRUCTURE_RDE_INCLUDE_ROLE_H_ [build/header_guard] [5] osaf/services/infrastructure/rde/include/role.h:59: #endif line should be "#endif // OSAF_SERVICES_INFRASTRUCTURE_RDE_INCLUDE_ROLE_H_" [build/header_guard] [5] osaf/services/infrastructure/rde/include/role.h:23: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/include/role.h:24: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/include/role.h:33: "public:" should be preceded by a blank line [whitespace/blank_line] [3] Done processing osaf/services/infrastructure/rde/include/role.h osaf/services/infrastructure/rde/include/rde_amf.h:32: #ifndef header guard has wrong style, please use: OSAF_SERVICES_INFRASTRUCTURE_RDE_INCLUDE_RDE_AMF_H_ [build/header_guard] [5] osaf/services/infrastructure/rde/include/rde_amf.h:71: #endif line should be "#endif // OSAF_SERVICES_INFRASTRUCTURE_RDE_INCLUDE_RDE_AMF_H_" [build/header_guard] [5] osaf/services/infrastructure/rde/include/rde_amf.h:43: Include the directory when naming .h files [build/include] [4] osaf/services/infrastructure/rde/include/rde_amf.h:52: Missing spaces around = [whitespace/operators] [4] osaf/services/infrastructure/rde/include/rde_amf.h:53: Missing spaces around = [whitespace/operators] [4] Done processing osaf/services/infrastructure/rde/include/rde_amf.h osaf/services/infrastructure/rde/include/rde_rda.h:34: #ifndef header guard has wrong style, please use: OSAF_SERVICES_INFRASTRUCTURE_RDE_INCLUDE_RDE_RDA_H_ [build/header_guard] [5] osaf/services/infrastructure/rde/include/rde_rda.h:104: #endif line should be "#endif // OSAF_SERVICES_INFRASTRUCTURE_RDE_INCLUDE_RDE_RDA_H_" [build/header_guard] [5] osaf/services/infrastructure/rde/include/rde_rda.h:37: Include the directory when naming .h files [build/include] [4] Done processing osaf/services/infrastructure/rde/include/rde_rda.h Complete diffstat: ------------------ osaf/libs/agents/infrastructure/rda/rda.h | 48 +++++++----------------------------------------- osaf/libs/agents/infrastructure/rda/rda_papi.cc | 61 +++++++++++++++++++++++++++++++++++++------------------------ osaf/libs/core/include/ncs_osprm.h | 2 +- osaf/libs/core/include/ncssysf_tsk.h | 2 +- osaf/libs/core/include/rda_papi.h | 10 +++++----- osaf/libs/core/leap/sysf_tsk.c | 2 +- osaf/services/infrastructure/rde/Makefile.am | 1 + osaf/services/infrastructure/rde/include/rde_amf.h | 20 +++++++------------- osaf/services/infrastructure/rde/include/rde_cb.h | 37 ++++++++++++++----------------------- osaf/services/infrastructure/rde/include/rde_rda.h | 8 ++++---- osaf/services/infrastructure/rde/include/rde_rda_common.h | 10 +++++----- osaf/services/infrastructure/rde/include/role.h | 18 +++++++++--------- osaf/services/infrastructure/rde/rde_amf.cc | 31 +++++++++++++++---------------- osaf/services/infrastructure/rde/rde_main.cc | 46 ++++++++++++++++++++++------------------------ osaf/services/infrastructure/rde/rde_mds.cc | 24 ++++++++++++------------ osaf/services/infrastructure/rde/rde_rda.cc | 23 +++++++++++------------ osaf/services/infrastructure/rde/role.cc | 25 +++++++++++++------------ 17 files changed, 165 insertions(+), 203 deletions(-) Testing Commands: ----------------- make cpplint Testing, Expected Results: -------------------------- No cpplint warnings in RDE or RDA Conditions of Submission: ------------------------- Ack from reviewer(s) Arch Built Started Linux distro ------------------------------------------- mips n n mips64 n n x86 n n x86_64 y y powerpc n n powerpc64 n n Reviewer Checklist: ------------------- [Submitters: make sure that your review doesn't trigger any checkmarks!] Your checkin has not passed review because (see checked entries): ___ Your RR template is generally incomplete; it has too many blank entries that need proper data filled in. ___ You have failed to nominate the proper persons for review and push. ___ Your patches do not have proper short+long header ___ You have grammar/spelling in your header that is unacceptable. ___ You have exceeded a sensible line length in your headers/comments/text. ___ You have failed to put in a proper Trac Ticket # into your commits. ___ You have incorrectly put/left internal data in your comments/files (i.e. internal bug tracking tool IDs, product names etc) ___ You have not given any evidence of testing beyond basic build tests. Demonstrate some level of runtime or other sanity testing. ___ You have ^M present in some of your files. These have to be removed. ___ You have needlessly changed whitespace or added whitespace crimes like trailing spaces, or spaces before tabs. ___ You have mixed real technical changes with whitespace and other cosmetic code cleanup changes. These have to be separate commits. ___ You need to refactor your submission into logical chunks; there is too much content into a single commit. ___ You have extraneous garbage in your review (merge commits etc) ___ You have giant attachments which should never have been sent; Instead you should place your content in a public tree to be pulled. ___ You have too many commits attached to an e-mail; resend as threaded commits, or place in a public tree for a pull. ___ You have resent this content multiple times without a clear indication of what has changed between each re-send. ___ You have failed to adequately and individually address all of the comments and change requests that were proposed in the initial review. ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc) ___ Your computer have a badly configured date and time; confusing the the threaded patch review. ___ Your changes affect IPC mechanism, and you don't present any results for in-service upgradability test. ___ Your changes affect user manual and documentation, your patch series do not contain the patch that updates the Doxygen manual. ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
