Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
lingol committed Oct 16, 2018
1 parent 2abeaa7 commit dfaa113
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ ObjCBlockIndentWidth: 4
Language: Java
ColumnLimit: 100
AllowShortFunctionsOnASingleLine: None
BreakBeforeBinaryOperators: NonAssignment
2 changes: 1 addition & 1 deletion Android/MMKV/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'
classpath 'digital.wup:android-maven-publish:3.6.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Expand Down
13 changes: 6 additions & 7 deletions Android/MMKV/mmkv/src/main/cpp/MMKV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include "aes/AESCrypt.h"
#include "aes/openssl/md5.h"
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cstring>
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
Expand Down Expand Up @@ -1220,9 +1220,8 @@ static void mkSpecialCharacterFileDirectory() {
static string md5(const string &value) {
unsigned char md[MD5_DIGEST_LENGTH];
char tmp[3] = {'\0'}, buf[33] = {'\0'};
MD5((const unsigned char *)value.c_str(), value.size(), md);
for(int i = 0;i < MD5_DIGEST_LENGTH;i++)
{
MD5((const unsigned char *) value.c_str(), value.size(), md);
for (int i = 0; i < MD5_DIGEST_LENGTH; i++) {
sprintf(tmp, "%2.2x", md[i]);
strcat(buf, tmp);
}
Expand All @@ -1244,8 +1243,7 @@ static string encodeFilePath(const string &mmapID) {
static pthread_once_t once_control = PTHREAD_ONCE_INIT;
pthread_once(&once_control, mkSpecialCharacterFileDirectory);
return SPECIAL_CHARACTER_DIRECTORY_NAME + "/" + filePath;
}
else {
} else {
return mmapID;
}
return filePath;
Expand All @@ -1257,5 +1255,6 @@ static string mappedKVPathWithID(const string &mmapID, MMKVMode mode) {
}

static string crcPathWithID(const string &mmapID, MMKVMode mode) {
return (mode & MMKV_ASHMEM) == 0 ? g_rootDir + "/" + encodeFilePath(mmapID) + ".crc" : encodeFilePath(mmapID) + ".crc";
return (mode & MMKV_ASHMEM) == 0 ? g_rootDir + "/" + encodeFilePath(mmapID) + ".crc"
: encodeFilePath(mmapID) + ".crc";
}
2 changes: 1 addition & 1 deletion Android/MMKV/mmkv/src/main/java/com/tencent/mmkv/MMKV.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static MMKV mmkvWithID(String mmapID, int mode, String cryptKey) {
MMKV mmkv = parcelableMMKV.toMMKV();
if (mmkv != null) {
System.out.println(mmkv.mmapID() + " fd = " + mmkv.ashmemFD()
+ ", meta fd = " + mmkv.ashmemMetaFD());
+ ", meta fd = " + mmkv.ashmemMetaFD());
}
return mmkv;
}
Expand Down

0 comments on commit dfaa113

Please sign in to comment.