From f2bc6a8e88fc00ccbcd1b5e071ed6ba6bf1a0d05 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Thu, 4 May 2023 13:52:56 -0500 Subject: [PATCH 1/3] Reclassify .toml files as .c files on GitHub With the new test framework, GitHub really wants to mark littlefs as a python project. telling it to reclassify our test .toml files as C code (which they are 95% of anyways) remedies this. An alternative would be to add syntax=c vim modelines to the test/bench files, which would also render them with C syntax highlighting on GitHub. Unfortunately the interspersed toml metadata mucks this up, making the result not very useful. --- .gitattributes | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..26d04251 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +# GitHub really wants to mark littlefs as a python project, telling it to +# reclassify our test .toml files as C code (which they are 95% of anyways) +# remedies this +*.toml linguist-language=c From 6fda813ce8e3ac129628e51253640fb2c92117f6 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 5 May 2023 12:11:20 +0200 Subject: [PATCH 2/3] Fix build for AVR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the overflowing left shift on 8 bit platforms. littlefs2/lfs.c: In function ‘lfs_dir_commitcrc’: littlefs2/lfs.c:1654:51: error: left shift count >= width of type [-Werror=shift-count-overflow] commit->ptag = ntag ^ ((0x80 & ~eperturb) << 24); --- lfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lfs.c b/lfs.c index d2f3b5e9..f0daf540 100644 --- a/lfs.c +++ b/lfs.c @@ -1651,7 +1651,7 @@ static int lfs_dir_commitcrc(lfs_t *lfs, struct lfs_commit *commit) { commit->off = noff; // perturb valid bit? - commit->ptag = ntag ^ ((0x80 & ~eperturb) << 24); + commit->ptag = ntag ^ ((0x80UL & ~eperturb) << 24); // reset crc for next commit commit->crc = 0xffffffff; From 8a4ee65fc3caac42dbbd19073240c97ce599b1c0 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Wed, 17 May 2023 11:11:27 -0500 Subject: [PATCH 3/3] Removed unnecessary sys/types.h include Likely included at some point for ssize_t, this is no longer needed and causes some problems for embedded compilers. Currently littlefs doesn't even use size_t/ssize_t in its definition of lfs_size_t/lfs_ssize_t, so I don't think this will ever be required. Found by LDong-Arm, vvn-git --- lfs_util.h | 1 - 1 file changed, 1 deletion(-) diff --git a/lfs_util.h b/lfs_util.h index 7f79defd..13e93961 100644 --- a/lfs_util.h +++ b/lfs_util.h @@ -23,7 +23,6 @@ // System includes #include #include -#include #include #include