Add global Foundation header file.

Fix some missed memory allocation function usage.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2682 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Scott Christley 1998-01-03 21:27:44 +00:00
parent 104b517b3d
commit 2c49c63e47
15 changed files with 134 additions and 24 deletions

View file

@ -1,3 +1,30 @@
Sat Jan 3 14:05:32 1998 Scott Christley <scottc@net-community.com>
* confdefs.h: Delete transient file.
* src/include/Foundation.h: New file.
* src/include/NSEnumerator.h: New file.
* src/GNUmakefile: Install new header files.
* src/include/NSUtilities.h: Move NSEnumerator interface
to NSEnumerator.h file.
* src/NSObject.m (-copyWithZone:): Eliminate semicolon.
* Fix memory allocation function usage. (As reported by
Matthias Klose <Matthias.Klose@cs.tu-berlin.de>).
* src/Connection.m (-_service_forwardForProxy:): Use
function instead of function pointer.
* src/Decoder.m (-decodeClass, -decodeSelectorWithName:): Likewise.
* src/Invocation.m (-initWithReturnType:): Likewise.
(-_initArgframeFrom:withType:retainArgs:): Likewise.
(-_deallocArgFrame): Likewise.
* src/NSAutoreleasePool.m (-reallyDealloc): Likewise.
* src/NSConnection.m (-_service_forwardForProxy:): Likewise.
* src/TextCStream.m (-decodeValueOfCType:at:withName:): Likewise.
* src/include/objc-gnu2next.h (list_cons): Likewise.
(list_remove_head, list_free): Likewise.
* src/include/preface.h.in (OBJC_FREE): Likewise.
Fri Jan 2 13:04:53 1998 Adam Fedor <fedor@doc.com>
* doc/Makefile.postamble: Generate html,texi from tmpl.texi files.

View file

@ -0,0 +1,48 @@
/*
Global include file for the GNUstep Base Library.
Copyright (C) 1997 Free Software Foundation, Inc.
Written by: Scott Christley <scottc@net-community.com>
Date: Sep 1997
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __Foundation_h_GNUSTEP_BASE_INCLUDE
#define __Foundation_h_GNUSTEP_BASE_INCLUDE
#include <Foundation/NSObject.h>
#include <Foundation/NSArchiver.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSException.h>
#include <Foundation/NSBundle.h>
#include <Foundation/NSDate.h>
#include <Foundation/NSData.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSCharacterSet.h>
#include <Foundation/NSCoder.h>
#include <Foundation/NSLock.h>
#include <Foundation/NSFileManager.h>
#include <Foundation/NSValue.h>
#include <Foundation/NSNotification.h>
#include <Foundation/NSPortCoder.h>
#include <Foundation/NSProcessInfo.h>
#include <Foundation/NSUserDefaults.h>
#endif /* __Foundation_h_GNUSTEP_BASE_INCLUDE */

View file

@ -0,0 +1,35 @@
/*
NSEnumerator.h
Copyright (C) 1998 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: January 1998
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __NSEnumerator_h_GNUSTEP_BASE_INCLUDE
#define __NSEnumerator_h_GNUSTEP_BASE_INCLUDE
#include <Foundation/NSObject.h>
@interface NSEnumerator : NSObject
- (id) nextObject;
@end
#endif /* __NSEnumerator_h_GNUSTEP_BASE_INCLUDE */

View file

@ -24,10 +24,9 @@
#ifndef __NSUtilties_h_GNUSTEP_BASE_INCLUDE
#define __NSUtilties_h_GNUSTEP_BASE_INCLUDE
#include <Foundation/NSObject.h>
@interface NSEnumerator : NSObject
- (id) nextObject;
@end
#include <Foundation/NSObjCRuntime.h>
#include <Foundation/NSString.h>
#include <Foundation/NSDictionary.h>
#include <Foundation/NSEnumerator.h>
#endif /* __NSUtilties_h_GNUSTEP_BASE_INCLUDE */

View file

@ -164,7 +164,7 @@ list_cons(void* head, struct objc_list* tail)
{
struct objc_list* cell;
cell = (struct objc_list*)(*objc_malloc)(sizeof(struct objc_list));
cell = (struct objc_list*)objc_malloc(sizeof(struct objc_list));
cell->head = head;
cell->tail = tail;
return cell;
@ -209,11 +209,11 @@ list_remove_head(struct objc_list** list)
{
struct objc_list* tail = (*list)->tail; /* fetch next */
*(*list) = *tail;/* copy next to list head */
(*objc_free)(tail);/* free next */
objc_free(tail);/* free next */
}
else/* only one element in list */
{
(*objc_free)(*list);
objc_free(*list);
(*list) = 0;
}
}
@ -265,7 +265,7 @@ list_free(struct objc_list* list)
if(list)
{
list_free(list->tail);
(*objc_free)(list);
objc_free(list);
}
}

View file

@ -95,7 +95,7 @@ extern const char o_NeXT_cc_version[];
((VAR) = (TYPE *) objc_realloc ((VAR), (unsigned)(NUM)*sizeof(TYPE)))
#define OBJC_CALLOC(VAR, TYPE, NUM) \
((VAR) = (TYPE *) objc_calloc ((unsigned)(NUM), sizeof(TYPE)))
#define OBJC_FREE(PTR) (*objc_free)((PTR))
#define OBJC_FREE(PTR) objc_free (PTR)
#ifndef MAX
#define MAX(a,b) \

View file

@ -763,7 +763,7 @@ static int messages_received_count;
NS_ENDHANDLER;
if (forward_type)
(*objc_free) (forward_type);
objc_free (forward_type);
}
- (Proxy*) rootProxy

View file

@ -413,7 +413,7 @@ static id dummyObject;
fprintf(stderr,
"Decoder decoding registered class xref %u\n", xref);
}
(*objc_free) (class_name);
objc_free (class_name);
break;
}
default:
@ -496,8 +496,8 @@ static id dummyObject;
fprintf(stderr,
"Decoder decoding registered sel xref %u\n", xref);
}
(*objc_free)(sel_name);
(*objc_free)(sel_types);
objc_free(sel_name);
objc_free(sel_types);
break;
}
default:

View file

@ -382,6 +382,7 @@ NSCallBacks.h \
tzfile.h
BASE_HEADERS = \
Foundation/Foundation.h \
Foundation/byte_order.h \
Foundation/DistributedObjects.h \
Foundation/NSArchiver.h \
@ -401,6 +402,7 @@ Foundation/NSDebug.h \
Foundation/NSDictionary.h \
Foundation/NSDistantObject.h \
Foundation/NSDistributedLock.h \
Foundation/NSEnumerator.h \
Foundation/NSException.h \
Foundation/NSFileHandle.h \
Foundation/NSFileManager.h \

View file

@ -65,7 +65,7 @@
{
/* Work around bug in objc_sizeof_type; it doesn't handle void type */
return_size = objc_sizeof_type (enc);
return_value = (*objc_calloc) (1, return_size);
return_value = objc_calloc (1, return_size);
}
else
{
@ -329,9 +329,9 @@ my_method_get_next_argument (arglist_t argframe,
/* allocate the argframe */
stack_argsize = types_get_size_of_stack_arguments (type);
reg_argsize = types_get_size_of_register_arguments(type);
argframe = (arglist_t) (*objc_calloc) (1 ,sizeof(char*) + reg_argsize);
argframe = (arglist_t) objc_calloc (1 ,sizeof(char*) + reg_argsize);
if (stack_argsize)
argframe->arg_ptr = (*objc_calloc) (1, stack_argsize);
argframe->arg_ptr = objc_calloc (1, stack_argsize);
else
argframe->arg_ptr = 0;
@ -461,8 +461,8 @@ my_method_get_next_argument (arglist_t argframe,
if (argframe)
{
if (argframe->arg_ptr)
(*objc_free) (argframe->arg_ptr);
(*objc_free) (argframe);
objc_free (argframe->arg_ptr);
objc_free (argframe);
}
}

View file

@ -343,7 +343,7 @@ pop_pool_from_cache (struct autorelease_thread_vars *tv)
for (a = _released_head; a; )
{
void *n = a->next;
(*objc_free) (a);
objc_free (a);
a = n;
}
[super dealloc];

View file

@ -1247,7 +1247,7 @@ static int messages_received_count;
NS_ENDHANDLER;
if (forward_type)
(*objc_free) (forward_type);
objc_free (forward_type);
}
- (void) _service_rootObject: rmc

View file

@ -149,7 +149,7 @@ extraRefCount (id anObject)
return [[self alloc] init];
}
- copyWithZone:(NSZone *)zone;
- copyWithZone:(NSZone *)zone
{
return NSCopyObject (self, 0, zone);
}

View file

@ -332,7 +332,7 @@ if (debug_textcoder) \
freeWhenDone: YES]
autorelease];
else
(*objc_free) (tmpname);
objc_free (tmpname);
}

View file

@ -1 +0,0 @@