Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup warnings #2138

Merged
merged 3 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions src/include/c_api/kuzu.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct ArrowArray {
/**
* @brief Stores runtime configuration for creating or opening a Database
*/
KUZU_C_API typedef struct {
typedef struct {
// bufferPoolSize Max size of the buffer pool in bytes.
// The larger the buffer pool, the more data from the database files is kept in memory,
// reducing the amount of File I/O
Expand All @@ -121,59 +121,69 @@ KUZU_C_API typedef struct {
/**
* @brief kuzu_database manages all database components.
*/
KUZU_C_API typedef struct { void* _database; } kuzu_database;
typedef struct {
void* _database;
} kuzu_database;

/**
* @brief kuzu_connection is used to interact with a Database instance. Each connection is
* thread-safe. Multiple connections can connect to the same Database instance in a multi-threaded
* environment.
*/
KUZU_C_API typedef struct { void* _connection; } kuzu_connection;
typedef struct {
void* _connection;
} kuzu_connection;

/**
* @brief kuzu_prepared_statement is a parameterized query which can avoid planning the same query
* for repeated execution.
*/
KUZU_C_API typedef struct {
typedef struct {
void* _prepared_statement;
void* _bound_values;
} kuzu_prepared_statement;

/**
* @brief kuzu_query_result stores the result of a query.
*/
KUZU_C_API typedef struct { void* _query_result; } kuzu_query_result;
typedef struct {
void* _query_result;
} kuzu_query_result;

/**
* @brief kuzu_flat_tuple stores a vector of values.
*/
KUZU_C_API typedef struct { void* _flat_tuple; } kuzu_flat_tuple;
typedef struct {
void* _flat_tuple;
} kuzu_flat_tuple;

/**
* @brief kuzu_logical_type is the kuzu internal representation of data types.
*/
KUZU_C_API typedef struct { void* _data_type; } kuzu_logical_type;
typedef struct {
void* _data_type;
} kuzu_logical_type;

/**
* @brief kuzu_value is used to represent a value with any kuzu internal dataType.
*/
KUZU_C_API typedef struct {
typedef struct {
void* _value;
bool _is_owned_by_cpp;
} kuzu_value;

/**
* @brief kuzu internal internal_id type which stores the table_id and offset of a node/rel.
*/
KUZU_C_API typedef struct {
typedef struct {
uint64_t table_id;
uint64_t offset;
} kuzu_internal_id_t;

/**
* @brief kuzu internal date type which stores the number of days since 1970-01-01 00:00:00 UTC.
*/
KUZU_C_API typedef struct {
typedef struct {
// Days since 1970-01-01 00:00:00 UTC.
int32_t days;
} kuzu_date_t;
Expand All @@ -182,15 +192,15 @@ KUZU_C_API typedef struct {
* @brief kuzu internal timestamp type which stores the number of microseconds since 1970-01-01
* 00:00:00 UTC.
*/
KUZU_C_API typedef struct {
typedef struct {
// Microseconds since 1970-01-01 00:00:00 UTC.
int64_t value;
} kuzu_timestamp_t;

/**
* @brief kuzu internal interval type which stores the months, days and microseconds.
*/
KUZU_C_API typedef struct {
typedef struct {
int32_t months;
int32_t days;
int64_t micros;
Expand All @@ -200,12 +210,14 @@ KUZU_C_API typedef struct {
* @brief kuzu_query_summary stores the execution time, plan, compiling time and query options of a
* query.
*/
KUZU_C_API typedef struct { void* _query_summary; } kuzu_query_summary;
typedef struct {
void* _query_summary;
} kuzu_query_summary;

/**
* @brief enum class for kuzu internal dataTypes.
*/
KUZU_C_API typedef enum {
typedef enum {
KUZU_ANY = 0,
KUZU_NODE = 10,
KUZU_REL = 11,
Expand Down
2 changes: 1 addition & 1 deletion src/include/function/arithmetic/arithmetic_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct Abs {
if constexpr (std::is_unsigned_v<T>) {
result = input;
} else {
result = abs(input);
result = std::abs(input);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion tools/shell/embedded_shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ void EmbeddedShell::printExecutionResult(QueryResult& queryResult) const {
if (numTuples == 1) {
printf("(1 tuple)\n");
} else {
printf("(%llu tuples)\n", numTuples);
printf("(%lu tuples)\n", numTuples);
}
printf("Time: %.2fms (compiling), %.2fms (executing)\n", querySummary->getCompilingTime(),
querySummary->getExecutionTime());
Expand Down