alarmclockmanage 文件夹更改
authorluozheng <1732036298@qq.com>
Tue, 28 May 2024 13:24:59 +0000 (21:24 +0800)
committerluozheng <1732036298@qq.com>
Tue, 28 May 2024 13:24:59 +0000 (21:24 +0800)
code/sdk/application/wearable/fd230app/nativeui/alarmclockmanage/include/AlarmClockManage.h
code/sdk/application/wearable/fd230app/nativeui/alarmclockmanage/src/AlarmClockManage.cpp

index c233658..869857e 100644 (file)
@@ -7,10 +7,10 @@
 #ifndef ALARM_CLOCK_MANAGE_H\r
 #define ALARM_CLOCK_MANAGE_H\r
 \r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include <time.h>\r
-#include <limits.h>\r
+#include <cstdio>\r
+#include <cstdlib>\r
+#include <ctime>\r
+#include <climits>\r
 \r
 #include "ohos_types.h"\r
 #include "AlarmClockTimerConfig.h"\r
index ff057c3..8d03ec0 100644 (file)
@@ -6,11 +6,11 @@
 
 #include <sys/stat.h>
 #include <sys/time.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdio>
+#include <cstdlib>
 #include <iostream>
 #include <fstream>
-#include <limits.h>
+#include <climits>
 #include <list>
 
 #include "wearable_log.h"
@@ -221,8 +221,8 @@ static int32 AlarmInfoCheck(const AlarmClockInfo *alarmInfo)
     uint16 hour;
     uint16 min;
 
-    if (alarmInfo == NULL) {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmInfoCheck alarmInfo NULL!!");
+    if (alarmInfo == nullptr) {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlarmInfoCheck alarmInfo nullptr!!");
         return STATUS_POINTER_NULL;
     }
 
@@ -367,10 +367,10 @@ static void EventAlarmRingProcess(void)
 
 static int32 SetFirstAlarmToday(FirstAlarmTodaySetType type)
 {
-    int32 ret;
     struct tm curTime;
     FirstAlarmTodaySetType tempType = type;
-    std::list< AlarmClockInfoToday>::iterator node, tempNode;
+    std::list< AlarmClockInfoToday>::iterator node;
+    std::list< AlarmClockInfoToday>::iterator tempNode;
 
     WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "SetFirstAlarmToday !!");
     if (AlarmGetCurrentTimeInfo(&curTime) != 0) {
@@ -498,7 +498,7 @@ void AlmmgrInitManagement(void)
 
 void AlmmgrAlarmClockEventProcess(const AlarmClockQueueMsg *alarmClockMsg)
 {
-    if (alarmClockMsg == NULL) {
+    if (alarmClockMsg == nullptr) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlmmgrAlarmClockEventProcess alarmClockMsg is invalid!!");
         return;
     }
@@ -683,8 +683,8 @@ int32 AlmmgrGetManagement(AlarmClockManagement *management)
     int32 ret;
     uint32 size = sizeof(AlarmClockManagement);
 
-    if (management == NULL) {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlmmgrGetManagement management NULL!!");
+    if (management == nullptr) {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlmmgrGetManagement management nullptr!!");
         return STATUS_POINTER_NULL;
     }
 
@@ -715,8 +715,8 @@ int32 GetEventAlarmInfo(uint8 id, AlarmClockInfo *info)
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetEventAlarmInfo id invalid!!");
         return STATUS_ALARM_ID_INVALID;
     }
-    if (info == NULL) {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetEventAlarmInfo info NULL!!");
+    if (info == nullptr) {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetEventAlarmInfo info nullptr!!");
         return STATUS_POINTER_NULL;
     }
 
@@ -733,8 +733,8 @@ int32 GetSmartAlarmInfo(AlarmClockInfo *info)
     int32 ret;
     uint32 size = sizeof(AlarmClockInfo);
 
-    if (info == NULL) {
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetSmartAlarmInfo info NULL!!");
+    if (info == nullptr) {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GetSmartAlarmInfo info nullptr!!");
         return STATUS_POINTER_NULL;
     }
 
@@ -785,12 +785,12 @@ int32 SetDatetime(int32 argc, char *argv[])
     struct tm setTime;
     struct timeval timeVal;
     struct timezone timeZone;
-    char *endPtr = NULL;
+    char *endPtr = nullptr;
     int32 trans[DATETIME_PARA_NUM];
     /* 0, 5, 8, 11, 14, 17 are offset of year, month, day, hour, minute, second */
     uint32 offset[DATETIME_PARA_NUM] = {0, 5, 8, 11, 14, 17};
 
-    if (argc != 1 || argv[0] == NULL) {
+    if (argc != 1 || argv[0] == nullptr) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "set_datetime para invalid!!");
         goto help;
     }
@@ -850,7 +850,7 @@ int32 DispDatetime(void)
     struct tm curTime;
     time_t second;
 
-    second = time(NULL);
+    second = time(nullptr);
     (void)gmtime_r((const time_t *)&second, &curTime);
 
     ret = strftime(buff, sizeof(buff), "%A %c", &curTime);