commit: c8e60355c497a5c3bcab959df298de45e573ecb5
parent 80b9e8f11dfe52b3c45d65679bd167eb9888c4af
Author: Michael Forney <mforney@mforney.org>
Date: Tue, 4 Jun 2019 18:29:09 -0700
dosfsutils: Avoid statement expressions
Diffstat:
3 files changed, 75 insertions(+), 1 deletion(-)
diff --git a/.gitmodules b/.gitmodules
@@ -30,6 +30,7 @@
[submodule "pkg/dosfstools/src"]
path = pkg/dosfstools/src
url = https://github.com/dosfstools/dosfstools
+ ignore = all
[submodule "pkg/e2fsprogs/src"]
path = pkg/e2fsprogs/src
url = https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
diff --git a/pkg/dosfstools/patch/0001-Use-static-inline-function-instead-of-statement-expr.patch b/pkg/dosfstools/patch/0001-Use-static-inline-function-instead-of-statement-expr.patch
@@ -0,0 +1,73 @@
+From 825f4980d59f780e906fc2d6b55fe6646df1b415 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Tue, 4 Jun 2019 10:40:53 -0700
+Subject: [PATCH] Use static inline function instead of statement expression
+
+---
+ src/lfn.c | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/src/lfn.c b/src/lfn.c
+index b33e125..9727ab3 100644
+--- a/src/lfn.c
++++ b/src/lfn.c
+@@ -74,14 +74,6 @@ static unsigned char fat_uni2esc[64] = {
+ /* for maxlen param */
+ #define UNTIL_0 INT_MAX
+
+-/* Convert name part in 'lfn' from unicode to ASCII */
+-#define CNV_THIS_PART(lfn) \
+- ({ \
+- unsigned char __part_uni[CHARS_PER_LFN*2]; \
+- copy_lfn_part( __part_uni, lfn ); \
+- cnv_unicode( __part_uni, CHARS_PER_LFN, 0 ); \
+- })
+-
+ /* Convert name parts collected so far (from previous slots) from unicode to
+ * ASCII */
+ #define CNV_PARTS_SO_FAR() \
+@@ -155,6 +147,14 @@ static void copy_lfn_part(unsigned char *dst, LFN_ENT * lfn)
+ memcpy(dst + 22, lfn->name11_12, 4);
+ }
+
++/* Convert name part in 'lfn' from unicode to ASCII */
++static inline char *cnv_this_part(LFN_ENT *lfn)
++{
++ unsigned char __part_uni[CHARS_PER_LFN*2];
++ copy_lfn_part( __part_uni, lfn );
++ return cnv_unicode( __part_uni, CHARS_PER_LFN, 0 );
++}
++
+ static void clear_lfn_slots(int start, int end)
+ {
+ int i;
+@@ -222,7 +222,7 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
+ * display the name) */
+ printf("A new long file name starts within an old one.\n");
+ if (slot == lfn_slot && lfn->alias_checksum == lfn_checksum) {
+- char *part1 = CNV_THIS_PART(lfn);
++ char *part1 = cnv_this_part(lfn);
+ char *part2 = CNV_PARTS_SO_FAR();
+ printf(" It could be that the LFN start bit is wrong here\n"
+ " if \"%s\" seems to match \"%s\".\n", part1, part2);
+@@ -262,7 +262,7 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
+ /* Causes: 1) start bit got lost, 2) Previous slot with start bit got
+ * lost */
+ /* Fixes: 1) delete LFN, 2) set start bit */
+- char *part = CNV_THIS_PART(lfn);
++ char *part = cnv_this_part(lfn);
+ printf("Long filename fragment \"%s\" found outside a LFN "
+ "sequence.\n (Maybe the start bit is missing on the "
+ "last fragment)\n", part);
+@@ -304,7 +304,7 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
+ printf("Unexpected long filename sequence number "
+ "(%d vs. expected %d).\n", slot, lfn_slot);
+ if (lfn->alias_checksum == lfn_checksum && lfn_slot > 0) {
+- char *part1 = CNV_THIS_PART(lfn);
++ char *part1 = cnv_this_part(lfn);
+ char *part2 = CNV_PARTS_SO_FAR();
+ printf(" It could be that just the number is wrong\n"
+ " if \"%s\" seems to match \"%s\".\n", part1, part2);
+--
+2.20.1
+
diff --git a/pkg/dosfstools/ver b/pkg/dosfstools/ver
@@ -1 +1 @@
-4.1 r0
+4.1 r1