Hi,

On 23 June 2010 14:48, Josh Allmann <[email protected]> wrote:
>
> Awesome -- patch 002 in this series also replaces memchr with strspn,
> as noted by Michael and Ronald.
>

Updated version attached.

> Josh
>
From abd99d7f37708fa6c41825eb4a2c37133f7d62f5 Mon Sep 17 00:00:00 2001
From: Josh Allmann <[email protected]>
Date: Wed, 23 Jun 2010 14:29:27 -0700
Subject: [PATCH 2/7] Use strspn rather than memchr in ff_skip_spaces.

---
 libavformat/internal.h |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavformat/internal.h b/libavformat/internal.h
index aaa71ac..ebe5d6b 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -175,15 +175,17 @@ int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
                      AVFormatContext *src);
 
 #define SPACE_CHARS " \t\r\n"
-/* we use memchr() instead of strchr() here because strchr() will return
+/* we use strspn() instead of strchr() here because strchr() will return
  * the terminating '\0' of SPACE_CHARS instead of NULL if c is '\0'. */
-#define redir_isspace(c) memchr(SPACE_CHARS, c, 4)
+#define redir_isspace(c) strspn(c, SPACE_CHARS)
 static inline void ff_skip_spaces(const char **pp)
 {
     const char *p;
+    int span;
+
     p = *pp;
-    while (redir_isspace(*p))
-        p++;
+    span = redir_isspace(p);
+    p += span;
     *pp = p;
 }
 
-- 
1.7.0.4

_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to