Skip to content

Commit

Permalink
Merge pull request #4235 from realm/merge-c72f2b-to-master
Browse files Browse the repository at this point in the history
Fix merge from c72f2b to master
  • Loading branch information
beeender authored Feb 24, 2017
2 parents cc82903 + f1fb827 commit c29c41d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 2.4.0
## 2.4.0 (YYYY-MM-DD)

### Breaking changes

Expand All @@ -20,7 +20,7 @@
- Use Object Store's notification mechanism to trigger listeners.
- Local commit triggers Realm global listener and `RealmObject` listener on current thread immediately instead of in the next event loop.

## 2.3.2
## 2.3.2 (YYYY-MM-DD)

### Bug fixes

Expand Down
10 changes: 4 additions & 6 deletions realm/realm-library/src/main/cpp/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved);
}
#endif

// Use this macro when logging a pointer using '%p'
#define VOID_PTR(ptr) reinterpret_cast<void*>(ptr)

#define STRINGIZE_DETAIL(x) #x
#define STRINGIZE(x) STRINGIZE_DETAIL(x)

Expand All @@ -74,8 +71,9 @@ std::string num_to_string(T pNumber)
#define MAX_JINT 0x7FFFFFFFL
#define MAX_JSIZE MAX_JINT

// TODO: Clean up those marcos. Casting with marcos reduces the readability, and it is actually breaking the C++ type
// conversion. e.g.: You cannot cast a pointer with S64 below.
// Helper macros for better readability
// Use S64() when logging
#define S(x) static_cast<size_t>(x)
#define B(x) static_cast<bool>(x)
#define S64(x) static_cast<int64_t>(x)
Expand Down Expand Up @@ -185,7 +183,7 @@ inline bool TableIsValid(JNIEnv* env, T* objPtr)

}
if (!valid) {
realm::jni_util::Log::e("Table %1 is no longer attached!", VOID_PTR(objPtr));
realm::jni_util::Log::e("Table %1 is no longer attached!", reinterpret_cast<int64_t>(objPtr));
ThrowException(env, IllegalState, "Table is no longer valid to operate on.");
}
return valid;
Expand All @@ -195,7 +193,7 @@ inline bool RowIsValid(JNIEnv* env, realm::Row* rowPtr)
{
bool valid = (rowPtr != NULL && rowPtr->is_attached());
if (!valid) {
realm::jni_util::Log::e("Row %1 is no longer attached!", VOID_PTR(rowPtr));
realm::jni_util::Log::e("Row %1 is no longer attached!", reinterpret_cast<int64_t>(rowPtr));
ThrowException(env, IllegalState, "Object is no longer valid to operate on. Was it deleted by another thread?");
}
return valid;
Expand Down

0 comments on commit c29c41d

Please sign in to comment.