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

Improve/modularize utils #155

Merged
merged 4 commits into from
Oct 5, 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
2 changes: 2 additions & 0 deletions common/include/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
libsqsh_common_headers = files(
'sqsh_data_private.h',
'sqsh_reader_private.h',
'sqsh_thread_private.h',
)

libsqsh_common_include = include_directories('.')
3 changes: 2 additions & 1 deletion common/include/sqsh_common_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include <sqsh_common.h>

#include <stdint.h>
#include <stdlib.h>
#include <string.h>

Expand Down Expand Up @@ -99,7 +100,7 @@ sqsh_address_ref_create(uint32_t outer_offset, uint16_t inner_offset) {

SQSH_NO_UNUSED static inline uint32_t
sqsh_datablock_size(uint32_t size_info) {
return size_info & ~(1 << 24);
return size_info & (uint32_t) ~(1 << 24);
}

SQSH_NO_UNUSED static inline bool
Expand Down
5 changes: 5 additions & 0 deletions common/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ libsqsh_common = static_library(
dependencies: libsqsh_common_dependencies,
install: false,
)

libsqsh_common_dep = declare_dependency(
link_with: libsqsh_common,
include_directories: libsqsh_common_include,
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 9 additions & 7 deletions common/src/meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
libsqsh_common_sources = files(
'compression_options_data.c',
'directory_data.c',
'fragment_data.c',
'inode_data.c',
'metablock_data.c',
'superblock_data.c',
'xattr_data.c',
'data/compression_options_data.c',
'data/directory_data.c',
'data/fragment_data.c',
'data/inode_data.c',
'data/metablock_data.c',
'data/superblock_data.c',
'data/xattr_data.c',
'reader/reader.c',
'utils/thread.c',
)
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions libsqsh/include/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ libsqsh_private_headers = files(
'sqsh_extract_private.h',
'sqsh_mapper_private.h',
'sqsh_metablock_private.h',
'sqsh_reader_private.h',
'sqsh_table_private.h',
'sqsh_thread_private.h',
'sqsh_tree_private.h',
'sqsh_xattr_private.h',
)
Expand Down
3 changes: 1 addition & 2 deletions libsqsh/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ endif

libsqsh_dependencies = [
cextras_dep,
libsqsh_common_dep,
]

libsqsh_c_args = []
Expand Down Expand Up @@ -45,11 +46,9 @@ libsqsh = both_libraries(
libsqsh_sources,
include_directories: [
libsqsh_private_include,
libsqsh_common_include,
libsqsh_include,
],
install: not meson.is_subproject(),
link_with: [libsqsh_common],
c_args: libsqsh_c_args,
dependencies: libsqsh_dependencies,
version: meson.project_version(),
Expand Down
2 changes: 0 additions & 2 deletions libsqsh/src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ libsqsh_sources = files(
'mapper/static_mapper.c',
'metablock/metablock_iterator.c',
'metablock/metablock_reader.c',
'reader/reader.c',
'table/export_table.c',
'table/fragment_table.c',
'table/id_table.c',
Expand All @@ -40,6 +39,5 @@ libsqsh_sources = files(
'tree/walker.c',
'utils/error.c',
'utils/posix.c',
'utils/thread.c',
'xattr/xattr_iterator.c',
)