Distributed File System written in C
fork

Configure Feed

Select the types of activity you want to include in your feed.

ci: Fixed compile warnings

+22 -28
+1 -1
build.sh
··· 6 6 mkdir -p .build/d2 7 7 mkdir -p .build/d3 8 8 9 - CFLAGS="-std=gnu99 -g -ggdb -Wall -Wextra -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wconversion -Wunreachable-code -pedantic -fsanitize=address -fsanitize=undefined -Wno-builtin-declaration-mismatch -save-temps" 9 + CFLAGS="-std=gnu99 -g -ggdb -Wall -Wextra -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wconversion -Wunreachable-code -pedantic -fsanitize=address -fsanitize=undefined -Wno-builtin-declaration-mismatch -save-temps -Wno-missing-braces" 10 10 11 11 for FILE in src/*.c; do 12 12 NAME="$(basename -s .c "${FILE}")"
+4 -7
src/copy.c
··· 65 65 exit(1); 66 66 } 67 67 68 - Byte buf1[BUF_LEN] = {0}; 69 - Byte buf2[BUF_LEN] = {0}; 70 - Buffer outside_buf = { .buf = buf1, .len = BUF_LEN }; 71 - Buffer inside_buf = { .buf = buf2, .len = BUF_LEN }; 72 68 bool from_server = Str_eq(argv[3], "-s"); 73 69 IPv4 ip = parse_address(argv[1]); 74 70 Port port = (Port)atoi(argv[2]); ··· 89 85 .tag = PUT, 90 86 .as.put = { 91 87 .fsize = b.size, 92 - .fname = atoss(source), 88 + .fname = atoss(dest), 93 89 }, 94 90 }; 95 91 Buffer put_buf = Command_serialize(put); ··· 97 93 free(put_buf.buf); 98 94 99 95 printf("INFO: Waiting for data nodes\n"); 100 - outside_buf.len = BUF_LEN; 96 + Byte buf1[BUF_LEN] = {0}; 97 + Buffer outside_buf = { .buf = buf1, .len = BUF_LEN }; 101 98 size_t len = recibe(enchufe, outside_buf); 102 - printf("INFO: Received data nodes from metadata server\n"); 103 99 expect(len != 0, "ERROR: Metadata server closed the connection right after sending a PUT request.\n"); 104 100 outside_buf.len = len; 101 + printf("INFO: Received data nodes from metadata server\n"); 105 102 ListDNode dnodes = ListDNode_deserialize(outside_buf); 106 103 107 104 printf("INFO: Commencing copy:\n");
+16 -16
src/lib/uuid.c
··· 6 6 ImplList(HexByte) 7 7 8 8 UUID_Str utoa(UUID uuid) { 9 - HexByte b01 = to_hex1((uuid.id1 >> 24) & 0xFF); 10 - HexByte b02 = to_hex1((uuid.id1 >> 16) & 0xFF); 11 - HexByte b03 = to_hex1((uuid.id1 >> 8) & 0xFF); 12 - HexByte b04 = to_hex1((uuid.id1 >> 0) & 0xFF); 13 - HexByte b05 = to_hex1((uuid.id2 >> 8) & 0xFF); 14 - HexByte b06 = to_hex1((uuid.id2 >> 0) & 0xFF); 15 - HexByte b07 = to_hex1((uuid.id3 >> 8) & 0xFF); 16 - HexByte b08 = to_hex1((uuid.id3 >> 0) & 0xFF); 17 - HexByte b09 = to_hex1((uuid.id4 >> 8) & 0xFF); 18 - HexByte b10 = to_hex1((uuid.id4 >> 0) & 0xFF); 19 - HexByte b11 = to_hex1((uuid.id5 >> 40) & 0xFF); 20 - HexByte b12 = to_hex1((uuid.id5 >> 36) & 0xFF); 21 - HexByte b13 = to_hex1((uuid.id5 >> 24) & 0xFF); 22 - HexByte b14 = to_hex1((uuid.id5 >> 16) & 0xFF); 23 - HexByte b15 = to_hex1((uuid.id5 >> 8) & 0xFF); 24 - HexByte b16 = to_hex1((uuid.id5 >> 0) & 0xFF); 9 + HexByte b01 = to_hex1((Byte)(uuid.id1 >> 24) & 0xFF); 10 + HexByte b02 = to_hex1((Byte)(uuid.id1 >> 16) & 0xFF); 11 + HexByte b03 = to_hex1((Byte)(uuid.id1 >> 8) & 0xFF); 12 + HexByte b04 = to_hex1((Byte)(uuid.id1 >> 0) & 0xFF); 13 + HexByte b05 = to_hex1((Byte)(uuid.id2 >> 8) & 0xFF); 14 + HexByte b06 = to_hex1((Byte)(uuid.id2 >> 0) & 0xFF); 15 + HexByte b07 = to_hex1((Byte)(uuid.id3 >> 8) & 0xFF); 16 + HexByte b08 = to_hex1((Byte)(uuid.id3 >> 0) & 0xFF); 17 + HexByte b09 = to_hex1((Byte)(uuid.id4 >> 8) & 0xFF); 18 + HexByte b10 = to_hex1((Byte)(uuid.id4 >> 0) & 0xFF); 19 + HexByte b11 = to_hex1((Byte)(uuid.id5 >> 40) & 0xFF); 20 + HexByte b12 = to_hex1((Byte)(uuid.id5 >> 36) & 0xFF); 21 + HexByte b13 = to_hex1((Byte)(uuid.id5 >> 24) & 0xFF); 22 + HexByte b14 = to_hex1((Byte)(uuid.id5 >> 16) & 0xFF); 23 + HexByte b15 = to_hex1((Byte)(uuid.id5 >> 8) & 0xFF); 24 + HexByte b16 = to_hex1((Byte)(uuid.id5 >> 0) & 0xFF); 25 25 return (UUID_Str){ .uuid = { b01.l, b01.r, b01.l, b01.r, b02.l, b02.r, b03.l, b03.r, b04.l, b04.r, '-', b05.l, b05.r, b06.l, b06.r, '-', b07.l, b07.r, b08.l, b08.r, '-', b09.l, b09.r, b10.l, b10.r, '-', b11.l, b11.r, b12.l, b12.r, b13.l, b13.r, b14.l, b14.r, b15.l, b15.r, b16.l, b16.r, '\0' } }; 26 26 } 27 27
+1 -4
src/ls.c
··· 15 15 Enchufe enchufe = enchufa(address, port); 16 16 conecta(enchufe); 17 17 18 - Command cmd = { 19 - .tag = LIST, 20 - . as = {0}, 21 - }; 18 + Command cmd = { .tag = LIST }; 22 19 Buffer inside_buf = Command_serialize(cmd); 23 20 zumba(enchufe, inside_buf); 24 21 Buffer_deinit(inside_buf);