Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ca1cc96 authored by Daniel Santiago Rivera's avatar Daniel Santiago Rivera
Browse files

Update LOG_WINDOW format params.

Params of size_t use %zu formatting, while int64_t use PRId64. These
params had not been updated in a while since LOG_WINDOW is a no-op
macro when LOG_NDEBUG is off.

Test: Enable LOG_NDEBUG and do make
Change-Id: I59e9fa1aa343fd0a1da83c40fd24f3ef7bae5ed4
parent 1e03521d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -466,7 +466,7 @@ static jboolean nativePutString(JNIEnv* env, jclass clazz, jlong windowPtr,
        return false;
    }

    LOG_WINDOW("%d,%d is TEXT with %u bytes", row, column, sizeIncludingNull);
    LOG_WINDOW("%d,%d is TEXT with %zu bytes", row, column, sizeIncludingNull);
    return true;
}

@@ -480,7 +480,7 @@ static jboolean nativePutLong(JNIEnv* env, jclass clazz, jlong windowPtr,
        return false;
    }

    LOG_WINDOW("%d,%d is INTEGER 0x%016llx", row, column, value);
    LOG_WINDOW("%d,%d is INTEGER %" PRId64, row, column, value);
    return true;
}

+7 −7
Original line number Diff line number Diff line
@@ -604,12 +604,12 @@ static CopyRowResult copyRow(JNIEnv* env, CursorWindow* window,
            size_t sizeIncludingNull = sqlite3_column_bytes(statement, i) + 1;
            status = window->putString(addedRows, i, text, sizeIncludingNull);
            if (status) {
                LOG_WINDOW("Failed allocating %u bytes for text at %d,%d, error=%d",
                LOG_WINDOW("Failed allocating %zu bytes for text at %d,%d, error=%d",
                        sizeIncludingNull, startPos + addedRows, i, status);
                result = CPR_FULL;
                break;
            }
            LOG_WINDOW("%d,%d is TEXT with %u bytes",
            LOG_WINDOW("%d,%d is TEXT with %zu bytes",
                    startPos + addedRows, i, sizeIncludingNull);
        } else if (type == SQLITE_INTEGER) {
            // INTEGER data
@@ -621,7 +621,7 @@ static CopyRowResult copyRow(JNIEnv* env, CursorWindow* window,
                result = CPR_FULL;
                break;
            }
            LOG_WINDOW("%d,%d is INTEGER 0x%016llx", startPos + addedRows, i, value);
            LOG_WINDOW("%d,%d is INTEGER %" PRId64, startPos + addedRows, i, value);
        } else if (type == SQLITE_FLOAT) {
            // FLOAT data
            double value = sqlite3_column_double(statement, i);
@@ -639,12 +639,12 @@ static CopyRowResult copyRow(JNIEnv* env, CursorWindow* window,
            size_t size = sqlite3_column_bytes(statement, i);
            status = window->putBlob(addedRows, i, blob, size);
            if (status) {
                LOG_WINDOW("Failed allocating %u bytes for blob at %d,%d, error=%d",
                LOG_WINDOW("Failed allocating %zu bytes for blob at %d,%d, error=%d",
                        size, startPos + addedRows, i, status);
                result = CPR_FULL;
                break;
            }
            LOG_WINDOW("%d,%d is Blob with %u bytes",
            LOG_WINDOW("%d,%d is Blob with %zu bytes",
                    startPos + addedRows, i, size);
        } else if (type == SQLITE_NULL) {
            // NULL field
@@ -757,7 +757,7 @@ static jlong nativeExecuteForCursorWindow(JNIEnv* env, jclass clazz,
    }

    LOG_WINDOW("Resetting statement %p after fetching %d rows and adding %d rows "
            "to the window in %d bytes",
            "to the window in %zu bytes",
            statement, totalRows, addedRows, window->size() - window->freeSpace());
    sqlite3_reset(statement);

+3 −3
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ status_t CursorWindow::create(const String8& name, size_t size, CursorWindow** o
                    result = window->clear();
                    if (!result) {
                        LOG_WINDOW("Created new CursorWindow: freeOffset=%d, "
                                "numRows=%d, numColumns=%d, mSize=%d, mData=%p",
                                "numRows=%d, numColumns=%d, mSize=%zu, mData=%p",
                                window->mHeader->freeOffset,
                                window->mHeader->numRows,
                                window->mHeader->numColumns,
@@ -124,7 +124,7 @@ status_t CursorWindow::createFromParcel(Parcel* parcel, CursorWindow** outCursor
                    CursorWindow* window = new CursorWindow(name, dupAshmemFd,
                            data, size, true /*readOnly*/);
                    LOG_WINDOW("Created CursorWindow from parcel: freeOffset=%d, "
                            "numRows=%d, numColumns=%d, mSize=%d, mData=%p",
                            "numRows=%d, numColumns=%d, mSize=%zu, mData=%p",
                            window->mHeader->freeOffset,
                            window->mHeader->numRows,
                            window->mHeader->numColumns,
@@ -200,7 +200,7 @@ status_t CursorWindow::allocRow() {
    FieldSlot* fieldDir = static_cast<FieldSlot*>(offsetToPtr(fieldDirOffset));
    memset(fieldDir, 0, fieldDirSize);

    LOG_WINDOW("Allocated row %u, rowSlot is at offset %u, fieldDir is %d bytes at offset %u\n",
    LOG_WINDOW("Allocated row %u, rowSlot is at offset %u, fieldDir is %zu bytes at offset %u\n",
            mHeader->numRows - 1, offsetFromPtr(rowSlot), fieldDirSize, fieldDirOffset);
    rowSlot->offset = fieldDirOffset;
    return OK;