From 245ae9804076ccdc6efcfee696e1197b2cd07483 Mon Sep 17 00:00:00 2001 From: zhirenx Date: Wed, 26 Jan 2022 10:59:03 +0800 Subject: [PATCH 1/2] code review fix Signed-off-by: zhirenx Change-Id: I6f4fe1e3cbaa0692f8c5781cb954a02b4676188f --- .../src/standard/messenger_device_session_manager.c | 3 +-- .../msglib/src/standard/messenger_device_status_manager.c | 2 +- baselib/utils/src/utils_base64.c | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/baselib/msglib/src/standard/messenger_device_session_manager.c b/baselib/msglib/src/standard/messenger_device_session_manager.c index 016102f..42e903f 100644 --- a/baselib/msglib/src/standard/messenger_device_session_manager.c +++ b/baselib/msglib/src/standard/messenger_device_session_manager.c @@ -12,20 +12,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "messenger_device_status_manager.h" #include #include "securec.h" #include "session.h" #include "softbus_bus_center.h" - #include "utils_list.h" #include "utils_log.h" #include "utils_mem.h" #include "utils_mutex.h" #include "messenger_device_session_manager.h" -#include "messenger_device_status_manager.h" #include "messenger_utils.h" #define IS_SERVER 0 diff --git a/baselib/msglib/src/standard/messenger_device_status_manager.c b/baselib/msglib/src/standard/messenger_device_status_manager.c index 24f8043..b94a8f7 100644 --- a/baselib/msglib/src/standard/messenger_device_status_manager.c +++ b/baselib/msglib/src/standard/messenger_device_status_manager.c @@ -77,7 +77,7 @@ static void ProcessDeviceStatusReceived(const uint8_t *data, uint32_t len) FREE(queueData); } -static inline void ProcessDeviceStatusReceiver(const DeviceIdentify *devId, uint32_t status, uint32_t devType) +static void ProcessDeviceStatusReceiver(const DeviceIdentify *devId, uint32_t status, uint32_t devType) { DeviceStatusManager *instance = GetDeviceManagerInstance(); diff --git a/baselib/utils/src/utils_base64.c b/baselib/utils/src/utils_base64.c index 7b0a73f..0e8cec3 100644 --- a/baselib/utils/src/utils_base64.c +++ b/baselib/utils/src/utils_base64.c @@ -113,10 +113,10 @@ static int32_t Base64Decode(const uint8_t *from, uint8_t *to, uint32_t toCheckLe } uint32_t toLen = fromLen / 4 * 3; /* Base64 decode size */ - if (from[fromLen - 1] == '=') { /* if last bit is null, make it "=" */ + if (from[fromLen - 1] == '=') { /* if last 1-bit is null, make it "=" */ toLen--; } - if (from[fromLen - 2] == '=') { /* if Second-to-last bit is null, make it "=" */ + if (from[fromLen - 2] == '=') { /* if last 2-bit is null, make it "=" */ toLen--; } if (toCheckLen < toLen) { @@ -141,10 +141,10 @@ static int32_t Base64Decode(const uint8_t *from, uint8_t *to, uint32_t toCheckLe (((a << 18) & 0x00FC0000) | ((b << 12) & 0x0003F000) | ((c << 6) & 0x00000FC0) | ((d << 0) & 0x0000003F)); if (j < toLen) { - to[j++] = (byte >> 16) & 0xFF; + to[j++] = (byte >> 16) & 0xFF; // 16, the 3rd 8-bit } if (j < toLen) { - to[j++] = (byte >> 8) & 0xFF; + to[j++] = (byte >> 8) & 0xFF; // 8, the 2nd 8-bit } if (j < toLen) { to[j++] = (byte >> 0) & 0xFF; -- Gitee From ca0baa3431025bdec780c6b712de72011cf5bba1 Mon Sep 17 00:00:00 2001 From: zhirenx Date: Wed, 26 Jan 2022 11:34:12 +0800 Subject: [PATCH 2/2] fix: code review fix Signed-off-by: zhirenx Change-Id: I5d466c3b96b6825db4ccbc5ff38cdc6da0ebb6f2 --- .../msglib/src/standard/messenger_device_session_manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/baselib/msglib/src/standard/messenger_device_session_manager.c b/baselib/msglib/src/standard/messenger_device_session_manager.c index 42e903f..9548fe8 100644 --- a/baselib/msglib/src/standard/messenger_device_session_manager.c +++ b/baselib/msglib/src/standard/messenger_device_session_manager.c @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "messenger_device_status_manager.h" +#include "messenger_device_session_manager.h" #include @@ -24,7 +24,7 @@ #include "utils_mem.h" #include "utils_mutex.h" -#include "messenger_device_session_manager.h" +#include "messenger_device_status_manager.h" #include "messenger_utils.h" #define IS_SERVER 0 -- Gitee