#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"
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;
}
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) {
void AlmmgrAlarmClockEventProcess(const AlarmClockQueueMsg *alarmClockMsg)
{
- if (alarmClockMsg == NULL) {
+ if (alarmClockMsg == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AlmmgrAlarmClockEventProcess alarmClockMsg is invalid!!");
return;
}
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;
}
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;
}
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;
}
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;
}
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);