clang-format styling matching upstream
Signed-off-by: Anestis Bechtsoudis <anestis@census-labs.com>
This commit is contained in:
parent
7ab241c783
commit
a8514caa7c
9
.clang-format
Normal file
9
.clang-format
Normal file
|
@ -0,0 +1,9 @@
|
|||
BasedOnStyle: Google
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
ColumnLimit: 100
|
||||
CommentPragmas: NOLINT:.*
|
||||
DerivePointerAlignment: false
|
||||
IndentWidth: 2
|
||||
PointerAlignment: Left
|
||||
TabWidth: 2
|
||||
UseTab: Never
|
4
Makefile
4
Makefile
|
@ -106,5 +106,5 @@ endif
|
|||
@$(RM) .depend
|
||||
@$(foreach SRC, $(SRCS), $(DEP_CXX) $(LIB_INCS) $(SRC) $(CFLAGS) -MT $(SRC:%.c=%.o) -MM >> .depend;)
|
||||
|
||||
indent:
|
||||
indent -linux -l100 -lc100 -nut -i4 *.cpp *.h; rm -f *~
|
||||
format:
|
||||
find . -regex '.*\.\(cpp\|hpp\|cc\|cxx\)' -exec clang-format -style=file -i {} \;
|
||||
|
|
|
@ -595,8 +595,8 @@ struct output_file* output_file_open_callback(int (*write)(void*, const void*, s
|
|||
int ret;
|
||||
struct output_file_callback* outc;
|
||||
|
||||
outc =
|
||||
reinterpret_cast<struct output_file_callback*>(calloc(1, sizeof(struct output_file_callback)));
|
||||
outc = reinterpret_cast<struct output_file_callback*>(
|
||||
calloc(1, sizeof(struct output_file_callback)));
|
||||
if (!outc) {
|
||||
error_errno("malloc struct outc");
|
||||
return nullptr;
|
||||
|
@ -663,8 +663,8 @@ int write_fd_chunk(struct output_file* out, unsigned int len, int fd, int64_t of
|
|||
|
||||
#ifndef _WIN32
|
||||
if (buffer_size > SIZE_MAX) return -E2BIG;
|
||||
char* data =
|
||||
reinterpret_cast<char*>(mmap64(nullptr, buffer_size, PROT_READ, MAP_SHARED, fd, aligned_offset));
|
||||
char* data = reinterpret_cast<char*>(
|
||||
mmap64(nullptr, buffer_size, PROT_READ, MAP_SHARED, fd, aligned_offset));
|
||||
if (data == MAP_FAILED) {
|
||||
return -errno;
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ int main(int argc, char* argv[]) {
|
|||
exit(-1);
|
||||
}
|
||||
|
||||
out_s = (struct sparse_file**) calloc(sizeof(struct sparse_file*), files);
|
||||
out_s = (struct sparse_file**)calloc(sizeof(struct sparse_file*), files);
|
||||
if (!out_s) {
|
||||
fprintf(stderr, "Failed to allocate sparse file array\n");
|
||||
exit(-1);
|
||||
|
|
|
@ -175,7 +175,8 @@ struct chunk_data {
|
|||
void* priv;
|
||||
unsigned int block;
|
||||
unsigned int nr_blocks;
|
||||
int (*write)(void* priv, const void* data, size_t len, unsigned int block, unsigned int nr_blocks);
|
||||
int (*write)(void* priv, const void* data, size_t len, unsigned int block,
|
||||
unsigned int nr_blocks);
|
||||
};
|
||||
|
||||
static int foreach_chunk_write(void* priv, const void* data, size_t len) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user