History log of /haiku/src/kits/storage/ResourceFile.cpp
Revision Date Author Comments
# 5705d286 13-Jun-2021 Murai Takashi <tmurai01@gmail.com>

storage kit: fix more wrong type of arguments to formatting function

Pointed out by LGTM

Change-Id: Iee81983a86cd71714dcedcf58f74bcea59ca619d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4607
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 0594775c 02-May-2021 Murai Takashi <tmurai01@gmail.com>

storage kit: fix Wrong type of arguments to formatting function

Pointed out by LGTM.

Change-Id: I802814ef53dd3f46a355db0a57926676037984a7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4080
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 1ed08f58 01-Jun-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

Speed up BResource loading

The code to parse the resource table reads one entry at a time because
the table size isn't known. This resulted in a lot of read syscalls,
each reading just 12 bytes. Use a BBufferIO to buffer these and reduce
the number of syscalls. This helps especially when there are lot of
resources, for example in libbe with all the country flags.

It also removes some spam from strace output for all these read calls.

Change-Id: Ib165a0eacc2bc5f3d319c22c2fac4f439efbdef2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2858
Reviewed-by: Rene Gollent <rene@gollent.com>


# 992ae400 18-Jan-2020 Murai Takashi <tmurai01@gmail.com>

Fix catching by value

Pointed out by LGTM.
Change-Id: I223655c728305f6f45b3738553da5b7d7a69e8c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2134
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 213ddbf6 14-May-2016 Mark Hellegers <mark@firedisk.net>

ResourceFile: Handle version info in resource in other endianness than host.

Fixes #12779.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
Includes some minor whitespace fixes by me.


# 0e17424c 26-Jul-2015 Adrien Destugues <pulkomandy@gmail.com>

PVS 112: check result of memcmp against 0.


# 3ec68008 26-Jul-2015 Adrien Destugues <pulkomandy@gmail.com>

PVS 109: useless check

error was already checked one line above.


# f7010474 01-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Changed resource alignment behaviour for ELF64 binaries.

The current behaviour of aligning to the maximum value of p_align seen
is problematic for x86_64, as the default segment alignment is 2MB.
This causes all x86_64 binaries to be padded to at least 2MB when
resources are added to them. There is no need to align to p_align in
the file itself (it's only an in-memory requirement), therefore
instead just align up to an 8-byte boundary. The current behaviour is
retained for ELF32, so this won't cause any compatibility problems
(there are no existing ELF64 BeOS/Haiku binaries to worry about).


# 81eee41e 01-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Don't read() the individual program and section headers, but rather read()
the respective tables at once.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34405 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d3ed58a7 25-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added ELF64 support to BResources.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34250 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ff4d0f1c 25-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Style cleanup.
* Removed AutoDeleter class and use the shared one instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34244 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 338b8dc3 29-Oct-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged changes from branch build_system_redesign at revision 14573.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f8947491 22-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added debug output macros.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10953 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17e6de7a 03-Aug-2003 shadow303 <shadow303@nowhere.fake>

gcc 3 fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4227 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 98833b15 11-Jun-2003 haydentech <haydentech@nowhere.fake>

Cleaned-up the std namespace support


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3475 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a0a3f269 03-Jun-2003 haydentech <haydentech@nowhere.fake>

Namespace- and gcc3-related fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3405 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 09d84e61 12-Aug-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Changed StorageKit namespace to BPrivate::Storage
+ Changed Sniffer namespace to BPrivate::Storage::Sniffer


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@714 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a38012 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0e17424c6fb8e7c7c3e024da2360de45a2aa6f03 26-Jul-2015 Adrien Destugues <pulkomandy@gmail.com>

PVS 112: check result of memcmp against 0.


# 3ec680083978d2e840ba9557881653e00e321a30 26-Jul-2015 Adrien Destugues <pulkomandy@gmail.com>

PVS 109: useless check

error was already checked one line above.


# f7010474bbc31cf0800e1dd0b7d0b03bb1b25b9b 01-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Changed resource alignment behaviour for ELF64 binaries.

The current behaviour of aligning to the maximum value of p_align seen
is problematic for x86_64, as the default segment alignment is 2MB.
This causes all x86_64 binaries to be padded to at least 2MB when
resources are added to them. There is no need to align to p_align in
the file itself (it's only an in-memory requirement), therefore
instead just align up to an 8-byte boundary. The current behaviour is
retained for ELF32, so this won't cause any compatibility problems
(there are no existing ELF64 BeOS/Haiku binaries to worry about).


# 81eee41edf5bef7feac94c6aff17205089cb61db 01-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Don't read() the individual program and section headers, but rather read()
the respective tables at once.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34405 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d3ed58a7c930f54288037be26894a38550ec787e 25-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added ELF64 support to BResources.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34250 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ff4d0f1c92561bfb1b14816606b7d9d4a4d946f7 25-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Style cleanup.
* Removed AutoDeleter class and use the shared one instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34244 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e05fe1042cce6e00d194a147802d4f9be 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 338b8dc301721b1f472e8297a898d4eaa2f2ee3a 29-Oct-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged changes from branch build_system_redesign at revision 14573.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f89474914e063df03a88e74060608532dc67aec2 22-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Added debug output macros.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10953 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17e6de7a37c5c61f45eb724de108daa70905cb8f 03-Aug-2003 shadow303 <shadow303@nowhere.fake>

gcc 3 fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4227 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 98833b15bf4967b0b12fda60065cda7ac83e091d 11-Jun-2003 haydentech <haydentech@nowhere.fake>

Cleaned-up the std namespace support


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3475 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a0a3f269a4eae19d6fdbffdb581e888219988160 03-Jun-2003 haydentech <haydentech@nowhere.fake>

Namespace- and gcc3-related fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3405 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 09d84e61b6c2629d253dce1e7d7e944943d3e40e 12-Aug-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Changed StorageKit namespace to BPrivate::Storage
+ Changed Sniffer namespace to BPrivate::Storage::Sniffer


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@714 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a380120846174213ccce9c4aab0dda17c72083 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96