Mercurial > emacs
comparison src/buffer.h @ 31411:920b03e019bf
(R_ALLOC_DECLARE): Removed because unused.
(r_alloc, r_re_alloc, r_alloc_free): Use POINTER_TYPE and size_t
in prototypes.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 06 Sep 2000 21:24:56 +0000 |
parents | 591a215915ca |
children | c3073b2c8dfa |
comparison
equal
deleted
inserted
replaced
31410:8bdf4d335cf9 | 31411:920b03e019bf |
---|---|
839 | 839 |
840 /* Allocation of buffer text. */ | 840 /* Allocation of buffer text. */ |
841 | 841 |
842 #ifdef REL_ALLOC | 842 #ifdef REL_ALLOC |
843 | 843 |
844 extern char *r_alloc P_ ((char **, unsigned long)); | 844 extern POINTER_TYPE *r_alloc P_ ((POINTER_TYPE **, size_t)); |
845 extern void r_alloc_free P_ ((char **ptr)); | 845 extern POINTER_TYPE *r_re_alloc P_ ((POINTER_TYPE **, size_t)); |
846 extern char *r_re_alloc P_ ((char **, unsigned long)); | 846 extern void r_alloc_free P_ ((POINTER_TYPE **ptr)); |
847 | 847 |
848 #define BUFFER_ALLOC(data,size) \ | 848 #define BUFFER_ALLOC(data, size) \ |
849 ((unsigned char *) r_alloc ((char **)&data, (size))) | 849 ((unsigned char *) r_alloc ((POINTER_TYPE **) &data, (size))) |
850 #define BUFFER_REALLOC(data,size) \ | 850 #define BUFFER_REALLOC(data, size) \ |
851 ((unsigned char *) r_re_alloc ((char **) &data, (size))) | 851 ((unsigned char *) r_re_alloc ((POINTER_TYPE **) &data, (size))) |
852 #define BUFFER_FREE(data) (r_alloc_free ((char **) &data)) | 852 #define BUFFER_FREE(data) (r_alloc_free ((POINTER_TYPE **) &data)) |
853 #define R_ALLOC_DECLARE(var,data) (r_alloc_declare (&var, (data))) | 853 |
854 #else | 854 #else /* not REL_ALLOC */ |
855 | |
855 #define BUFFER_ALLOC(data,size) (data = (unsigned char *) malloc ((size))) | 856 #define BUFFER_ALLOC(data,size) (data = (unsigned char *) malloc ((size))) |
856 #define BUFFER_REALLOC(data,size) ((unsigned char *) realloc ((data), (size))) | 857 #define BUFFER_REALLOC(data,size) ((unsigned char *) realloc ((data), (size))) |
857 #define BUFFER_FREE(data) (free ((data))) | 858 #define BUFFER_FREE(data) (free ((data))) |
858 #define R_ALLOC_DECLARE(var,data) | 859 |
859 #endif | 860 #endif /* not REL_ALLOC */ |
860 | 861 |
861 /*********************************************************************** | 862 /*********************************************************************** |
862 Buffer-local Variables | 863 Buffer-local Variables |
863 ***********************************************************************/ | 864 ***********************************************************************/ |
864 | 865 |