>> Freddie Chopin wrote:
FYI - I already had stuff in the works for this... -Duane.
> 1. replace alloca with malloc - that's Øyvind's patch, but I've fixed
> r vs. retval and I've removed one useless part.
Alternate method committed:
New Revision: 2407
> 2. add Newlib's strtok_r to r
Second attempt:
1. replace alloca with malloc - that's Øyvind's patch, but I've fixed r
vs. retval and I've removed one useless part.
2. add Newlib's strtok_r to replacements so that membuf.c could be build
on Windows
4\/3!!
Index: src/helper/membuf.c
===
On Fri, Jun 26, 2009 at 1:01 AM, Martin Panter wrote:
> On 25/06/2009, Øyvind Harboe wrote:
>> Attached is a patch that removes alloca().
>
> From the patch:
> - return ERROR_OK;
> +
> + r=ERROR_OK;
> +exit_fn:
> + free(pagebuffer);
> + return retval;
>
> Is it just me, or
On 25/06/2009, Øyvind Harboe wrote:
> Attached is a patch that removes alloca().
From the patch:
- return ERROR_OK;
+
+ r=ERROR_OK;
+exit_fn:
+ free(pagebuffer);
+ return retval;
Is it just me, or are you assigning everything to "r" and then
returning "retval" ins
alloca()? That's very unfriendly towards non-MMU
targets.
Attached is a patch that removes alloca().
--
Øyvind Harboe
Embedded software and hardware consulting services
http://www.zylin.com
Index: C:/workspace/openocd/src/flash/at91sam3.c
Rev 2403 fails on Windows/MinGW, because:
1. there is no strtok_r(), but strtok() is reentrant, so use that
patch file -> win32-strtok.patch
That was discussed earlier in "[Openocd-development] [Openocd-svn] r2381
- trunk/src/helper" thread
2. alloca() needs malloc.h included
patch file -> wi