ObjFW  Check-in [72af773f72]

Overview
Comment:Fix warnings on Leopard in OFConstString.
As there are no warnings anymore, reintroduce -Werror.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 72af773f72d806467bb88ce9f25977e45592ec17c7325cc587f07c0daae41238
User & Date: js on 2009-04-10 00:52:40
Other Links: manifest | tags
Context
2009-04-10
01:04
Too much was changed here from uint8_t to char. Fixed. check-in: e08efd62c2 user: js tags: trunk
00:52
Fix warnings on Leopard in OFConstString.
As there are no warnings anymore, reintroduce -Werror.
check-in: 72af773f72 user: js tags: trunk
2009-04-09
13:55
Use char* instead of uint8_t* for OFStreams and OFHashes.
This way, less casts are needed when using C libraries.
check-in: 722b6213c0 user: js tags: trunk
Changes

Modified configure.ac from [3085f27340] to [2984007ca4].

9
10
11
12
13
14
15





16
17
18
19
20
21
22
AC_PROG_LN_S
AC_PROG_EGREP

CFLAGS="$CFLAGS -Wall"
OBJCFLAGS="$OBJCFLAGS -Wall -fobjc-exceptions"
OBJCFLAGS="$OBJCFLAGS -fconstant-string-class=OFConstString"
LIBS="$LIBS -lobjc"






AX_CHECK_COMPILER_FLAGS(-pipe, [
	CFLAGS="$CFLAGS -pipe"
	OBJCFLAGS="$OBJCFLAGS -pipe"])
AX_CHECK_COMPILER_FLAGS(-fno-constant-cfstrings,
	[OBJCFLAGS="$OBJCFLAGS -fno-constant-cfstrings"])








>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
AC_PROG_LN_S
AC_PROG_EGREP

CFLAGS="$CFLAGS -Wall"
OBJCFLAGS="$OBJCFLAGS -Wall -fobjc-exceptions"
OBJCFLAGS="$OBJCFLAGS -fconstant-string-class=OFConstString"
LIBS="$LIBS -lobjc"

if test x"$GCC" = x"yes"; then
	CFLAGS="$CFLAGS -Werror"
	OBJCFLAGS="$OBJCFLAGS -Werror"
fi

AX_CHECK_COMPILER_FLAGS(-pipe, [
	CFLAGS="$CFLAGS -pipe"
	OBJCFLAGS="$OBJCFLAGS -pipe"])
AX_CHECK_COMPILER_FLAGS(-fno-constant-cfstrings,
	[OBJCFLAGS="$OBJCFLAGS -fno-constant-cfstrings"])

Modified src/OFConstString.m from [ebbddd5fa7] to [3998302843].

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#define OFCONSTSTRING_M
#import "OFConstString.h"
#import "OFString.h"
#import "OFExceptions.h"
#import "OFMacros.h"

#ifndef __objc_INCLUDE_GNU
struct objc_class _OFConstStringClassReference;
#endif

@implementation OFConstString
#ifndef __objc_INCLUDE_GNU
+ (void)load
{
	Class cls = objc_getClass("OFConstString");
	memcpy(&_OFConstStringClassReference, cls,
	    sizeof(_OFConstStringClassReference));
	objc_addClass(&_OFConstStringClassReference);
}
#endif

- (BOOL)isKindOf: (Class)c
{
	if (c == [OFConstString class])
		return YES;
	return NO;
}

- (const char*)cString
{
	return string;
}

- (size_t)length
{







|






<
|
|
<



<
<
<
<
<
<
<







18
19
20
21
22
23
24
25
26
27
28
29
30
31

32
33

34
35
36







37
38
39
40
41
42
43
#define OFCONSTSTRING_M
#import "OFConstString.h"
#import "OFString.h"
#import "OFExceptions.h"
#import "OFMacros.h"

#ifndef __objc_INCLUDE_GNU
void *_OFConstStringClassReference;
#endif

@implementation OFConstString
#ifndef __objc_INCLUDE_GNU
+ (void)load
{

	objc_setFutureClass((Class)&_OFConstStringClassReference,
	    "OFConstString");

}
#endif








- (const char*)cString
{
	return string;
}

- (size_t)length
{