From: Ben Pfaff Date: Thu, 28 Feb 2013 01:02:53 +0000 (-0800) Subject: ofpbuf: Remove OFPBUF_STACK_BUFFER. X-Git-Tag: v1.11.0~335 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=125638ebd7fa77fb98710ae0eb91b25172f9f725;p=cascardo%2Fovs.git ofpbuf: Remove OFPBUF_STACK_BUFFER. Its alleged convenience just doesn't outweigh the syntactical ugliness, and so it didn't have any users. Signed-off-by: Ben Pfaff --- diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c index fd10da361..c960a7e86 100644 --- a/lib/ofpbuf.c +++ b/lib/ofpbuf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ ofpbuf_use(struct ofpbuf *b, void *base, size_t allocated) * * 'base' should be appropriately aligned. Using an array of uint32_t or * uint64_t for the buffer is a reasonable way to ensure appropriate alignment - * for 32- or 64-bit data. OFPBUF_STACK_BUFFER is a convenient way to do so. + * for 32- or 64-bit data. * * An ofpbuf operation that requires reallocating data will assert-fail if this * function was used to initialize it. Thus, one need not call ofpbuf_uninit() @@ -72,7 +72,7 @@ ofpbuf_use_stack(struct ofpbuf *b, void *base, size_t allocated) * * 'base' should be appropriately aligned. Using an array of uint32_t or * uint64_t for the buffer is a reasonable way to ensure appropriate alignment - * for 32- or 64-bit data. OFPBUF_STACK_BUFFER is a convenient way to do so. + * for 32- or 64-bit data. * * An ofpbuf operation that requires reallocating data will copy the provided * buffer into a malloc()'d buffer. Thus, it is wise to call ofpbuf_uninit() diff --git a/lib/ofpbuf.h b/lib/ofpbuf.h index bae3c0aee..8b03c7efa 100644 --- a/lib/ofpbuf.h +++ b/lib/ofpbuf.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,10 +52,6 @@ struct ofpbuf { void *private_p; /* Private pointer for use by owner. */ }; -/* Declares NAME as a SIZE-byte array aligned properly for storing any kind of - * data. For use with ofpbuf_use_stack(). */ -#define OFPBUF_STACK_BUFFER(NAME, SIZE) uint64_t NAME[DIV_ROUND_UP(SIZE, 8)] - void ofpbuf_use(struct ofpbuf *, void *, size_t); void ofpbuf_use_stack(struct ofpbuf *, void *, size_t); void ofpbuf_use_stub(struct ofpbuf *, void *, size_t);