ObjFW  Check-in [abff9ac184]

Overview
Comment:Fix a warning when sizeof(size_t) < sizeof(long long).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 0.5
Files: files | file ages | folders
SHA3-256: abff9ac18457547b863c4fed3722510b2459870d497c3d4ffb3f6579069e956f
User & Date: js on 2011-04-25 14:14:49
Other Links: branch diff | manifest | tags
Context
2011-04-25
17:17
Skip possible BOMs in OFMutableString. check-in: 810b0028ed user: js tags: 0.5
14:14
Fix a warning when sizeof(size_t) < sizeof(long long). check-in: abff9ac184 user: js tags: 0.5
2011-04-23
02:15
OFMutableString: Call madvise() on the correct length. check-in: 6649214059 user: js tags: 0.5
Changes

Modified README from [2bffcb61ce] to [3ed6345b53].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

    $ ./autogen.sh


BUILDING AS A MAC OS X FRAMEWORK

  It is also possible to build ObjFW as a Mac OS X framework. To do so,
  just execute xcodebuild in the root directory of ObjFW or open the
  .xcodeproj in Xcode and choose Build -> Build from the menu. Copy the
  resulting ObjFW.framework to /Library/Frameworks and you are done.


USING THE MAC OS X FRAMWORK IN XCODE

  To use the Mac OS X framework in Xcode, you need to add the .framework
  to your project and add the following flags to "Other C Flags":







|
|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

    $ ./autogen.sh


BUILDING AS A MAC OS X FRAMEWORK

  It is also possible to build ObjFW as a Mac OS X framework. To do so,
  just execute xcodebuild -target ObjFW in the root directory of ObjFW or open
  the .xcodeproj in Xcode and choose Build -> Build from the menu. Copy the
  resulting ObjFW.framework to /Library/Frameworks and you are done.


USING THE MAC OS X FRAMWORK IN XCODE

  To use the Mac OS X framework in Xcode, you need to add the .framework
  to your project and add the following flags to "Other C Flags":

Modified src/OFString.m from [a034b6e9c4] to [d61077ef08].

662
663
664
665
666
667
668



669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
		OFFile *file;

		if (stat([path cString], &s) == -1)
			@throw [OFOpenFileFailedException newWithClass: isa
								  path: path
								  mode: @"rb"];




		file = [[OFFile alloc] initWithPath: path
					       mode: @"rb"];

		@try {
			tmp = [self allocMemoryWithSize: s.st_size];

			[file readExactlyNBytes: s.st_size
				     intoBuffer: tmp];
		} @finally {
			[file release];
		}
	} @catch (id e) {
		[self release];
		@throw e;
	}

	self = [self initWithCString: tmp
			    encoding: encoding
			      length: s.st_size];
	[self freeMemory: tmp];

	return self;
}

- initWithContentsOfURL: (OFURL*)url
{







>
>
>




|

|











|







662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
		OFFile *file;

		if (stat([path cString], &s) == -1)
			@throw [OFOpenFileFailedException newWithClass: isa
								  path: path
								  mode: @"rb"];

		if (s.st_size > SIZE_MAX)
			@throw [OFOutOfRangeException newWithClass: isa];

		file = [[OFFile alloc] initWithPath: path
					       mode: @"rb"];

		@try {
			tmp = [self allocMemoryWithSize: (size_t)s.st_size];

			[file readExactlyNBytes: (size_t)s.st_size
				     intoBuffer: tmp];
		} @finally {
			[file release];
		}
	} @catch (id e) {
		[self release];
		@throw e;
	}

	self = [self initWithCString: tmp
			    encoding: encoding
			      length: (size_t)s.st_size];
	[self freeMemory: tmp];

	return self;
}

- initWithContentsOfURL: (OFURL*)url
{