Commit Graph

202 Commits

Author SHA1 Message Date
Alex Smith 6c6fcaf95b Some build fixes for DEBUG=1. 2012-12-20 19:22:16 +00:00
Alex Smith c3f0fd28cd Fixed formatting of output in some debugger commands.
Currently all debugger commands assume 32-bit pointers when formatting their
output. This means that on x86_64 the output is incorrectly formatted. Fixed
this by adding a B_PRINTF_POINTER_WIDTH definition (16 on 64-bit, 8 on
32-bit), and using this to correctly format the output. Not all commands have
been fixed yet, but all VM, slab, VFS, team, thread and image commands should
be correct.
2012-07-12 11:29:33 +01:00
czeidler 14fc524be2 Style and performance fixes. Thanks Ingo and Stephan. 2011-12-17 14:36:36 +13:00
czeidler 779061f0cd Make BStringList derive from BFlattenable. The implementation is more or less copied from the mail version to stay compatible. Fix IndexOf which
was the implementation of HasString.
2011-12-15 19:45:06 +13:00
Ingo Weinhold 7de6af25e9 Add a BStringList class 2011-11-25 06:19:45 +01:00
Ingo Weinhold ad07ecd821 BString::Private class to access BString internals 2011-11-25 06:19:45 +01:00
Ingo Weinhold 156ea481b3 Add HashValue() methods to BString 2011-11-25 06:19:44 +01:00
Ingo Weinhold a54f7dc250 Move B_MIME_STRING_TYPE to <TypeConstants.h> 2011-11-25 06:19:24 +01:00
Axel Dörfler 362ae0a27e Added unimplemented copy constructor. 2011-11-21 23:57:19 +01:00
Axel Dörfler 29e07dd0eb Added a buffered DataIO subclass.
* Only the read path is tested so far.
2011-11-21 23:55:13 +01:00
Siarzhuk Zharski f37821851e Refactoring of 8-bit encodings support.
* Fixed issue introduced in hrev38139: restoring from the line
  drawing table was hard-coded to UTF8 Ground table. That is wrong:
  the table for currently configured encoding must be set back.
  Please look on using of _GuessGroundTable() for details;

* Fixed issue introduced in hrev34894: the semantic of convert_xx_utf8
  functions requires the destination length to be set equal to the
  target buffer size. Pre-hrev34894 usage of "homebrew" conversion
  functions was a bit different - destination length was set to 0.
  This made any converstions of input data useless and produce no
  visual results;

* Private list of supported encodings (Encoding.cpp) was replaced by
  using BPrivate::BCharacterSetRoster functionality. That allows to
  use centralized info about encodings in unified with other
  applications (Mail & StyledEdit for example) way. Most of currently
  enumerated in UTF8.h encodings now available in Terminal.
  Note that UCS-2 and UTF-16 are temporary (???) excluded from the
  list of encodings supported by Terminal.

* The B_UTF16_CONVERSION was added in system-wide UTF8.h declarations.
  This character set is available for enumerating by BCharacterSetRoster
  but not listed in public API. Looks like it was just missed;

* Special note about "Text Encoding" entry in Preference File:
  So known "shortname" of encoding was used in the preferences file.
  For details look on the encodings list in previous version of
  Encoding.cpp. As result of migrating to BCharacterSet-provided
  resources this list was deleted and is not available anymore.
  Instead of it the IANA name of the character encoding targeted
  to be used for this purposes. Frankly speaking this part looks
  like not working at the moment. The value of text encoding is
  hardcoded to "UTF-8" now and is not affected by any operations
  in Terminal menu. Note that "shortname" for default encoding
  was "UTF8" but the saved value is "UTF-8" - and they are looking
  not dependent at all. So this change should not introduce any
  kind of backward incompatibility.
2011-11-13 13:17:38 +01:00
Ingo Weinhold 19ae20e67e Merge branch 'master' into pm-flat
Conflicts:
	build/jam/HaikuImage
	build/jam/OptionalBuildFeatures
	build/jam/OptionalPackages
	build/jam/UserBuildConfig.sample
	data/bin/installoptionalpackage
	src/apps/deskbar/DeskbarMenu.cpp
	src/servers/debug/DebugServer.cpp
	src/system/kernel/fs/vfs.cpp
2011-11-05 17:00:01 +01:00
Clemens Zeidler f7953fa769 Add MoveItem method to easily move a item within a list. Fix line limit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42475 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-07-24 23:49:30 +00:00
Ingo Weinhold 808a51161a Add a BStringList class 2011-07-17 16:55:20 +02:00
Ingo Weinhold d0c417848b BString::Private class to access BString internals 2011-07-17 16:55:20 +02:00
Ingo Weinhold 5a54e156e5 Add HashValue() methods to BString 2011-07-17 16:55:19 +02:00
Ingo Weinhold 3e29244600 Move B_MIME_STRING_TYPE to <TypeConstants.h> 2011-07-17 16:55:09 +02:00
Ingo Weinhold 85b41b15d9 * Added bool and double BString::operator<<() versions.
* Removed the clashing operator in JobSetupDlg. Automatic whitespace
  cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42387 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-07-07 10:17:15 +00:00
Ingo Weinhold a928c3f001 operation <<(): Use the standard types [unsigned] long [long] instead of
[u]int32 and [u]int64 to avoid clashes with the int/unsigned int versions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42165 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-06-14 01:07:16 +00:00
Jonas Sundström b2d9843906 Add BString::IsEmpty() method.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41242 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-04-12 18:10:02 +00:00
Jonas Sundström a29fb9388d Rename and a small simplification. Thanks, Clemens and Ingo.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40756 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-03-01 08:26:00 +00:00
Jonas Sundström c9e27adabf Cleanup. Efficiency makerover.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40720 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-27 09:25:26 +00:00
Jonas Sundström 7581d0b224 BString::SetToArguments(). Forgot the header. :I
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-02-26 09:33:19 +00:00
Oliver Tappe 915a7b8c24 Make BObjectList<> publically available:
* cleaned up ObjectList.h
* switched several uses of new() to new(std::nothrow)
* moved ugly AsBList() hack into BObjectList<>::Private class and
  adjusted all callers accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40252 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-20 12:09:16 +00:00
Jérôme Duval 23281fb2c1 Moved Easter holidays methods to a Holiday class, an hopefully better place.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40125 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-05 18:00:31 +00:00
Jérôme Duval daf3c50529 * changed some methods to static as that's what they are in the end.
* added some methods to find out easter sunday, ascension and pentecost days.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40116 a95241bf-73f2-0310-859d-f6bbb57e9c96
2011-01-04 19:43:23 +00:00
Axel Dörfler e6cec9839d * BNetworkAddress isn't really BArchivable material, switched to BFlattenable
instead.
* Also actually implemented the serializing functionality this time, as usual
  completely untested, though :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39677 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-29 20:29:37 +00:00
Axel Dörfler 8bbce28359 * Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39675 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-11-29 19:39:13 +00:00
Stephan Aßmus 132cbf8cf7 Updated indentation and style.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38226 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-18 10:59:56 +00:00
Stephan Aßmus 81db321da2 Updated header indentation, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38225 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-18 10:38:30 +00:00
Rene Gollent 323e7fe567 Fix build error in IMAP client due to incorrect inequality check in one of BString's inlines. Fixes #6439.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38075 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-08-12 23:32:23 +00:00
Alex Wilson 45a167a94d In BUnarchiver::IsInstantiated(), catch a possible NULL dereference, make archive parameter to BUnarchiver::IsArchiveManaged() const.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-26 08:02:33 +00:00
Ingo Weinhold b137ab3eb3 Patch by Alex Wilson (minor changes by myself) related to the new archiving
features:
* Some cosmetic adjustments of the API, like using references instead of
  pointers, argument order, method names, etc.
* Added convenience template methods for archiving and unarchiving to BArchiver
  and BUnarchiver.
* BUnarchiver (respectively the private BUnarchiveManager) explicitly deals with
  object ownership, now. This is necessary since an error while unarchiving
  could leave an already unarchived object without owning object, which would
  result in it being leaked. The BUnarchiver::{Get,Find}Object() methods do now
  have an optional parameter to specify whether object ownership shall be
  transferred.
* Fixed incorrect header guard in headers/private/binary_compatibility/Global.h.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37538 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-16 16:49:42 +00:00
Stephan Aßmus b1008df2c2 Patch by Alex Wilson: Added convenience methods for storing BAlignment and BSize
in BMessages. Also added type codes for them in TypeConstants.h. Closes ticket
#6302. Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37511 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-14 07:02:38 +00:00
Ingo Weinhold fbb6335d2a Style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37432 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-08 15:04:38 +00:00
Ingo Weinhold e5150e2847 Patch by Alex Wilson (compilation fixes by myself): Extended the archiving/
unarchiving protocol to support archival of arbitrary object graphs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37431 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-07-08 14:54:25 +00:00
Ingo Weinhold 4a57f84396 Introduced types [__haiku_]generic_{addr,size}_t which are wide enough for
virtual and physical addresses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36996 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-06-02 18:22:38 +00:00
Ingo Weinhold ea021b94d8 * Moved phys_addr_t definition to SupportDefs.h.
* Added phys_size_t.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36934 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-25 11:18:38 +00:00
Ingo Weinhold d34daac82a * config/{HaikuConfig.h,types.h}:
- Added macro __HAIKU_ARCH_BITS specifying the architecture bitness (32/64)
    (might be more convenient to use than __HAIKU_ARCH_{32,64}_BIT).
  - Added macros __HAIKU_ARCH_PHYSICAL_BITS, __HAIKU_ARCH_PHYSICAL_{32,64}_BIT,
    and the types __haiku_phys_[s]addr_t. The intention is to use separate
    macros and types for virtual and physical addresses, since for some
    architectures (e.g. x86 with PAE) those actually differ.
* sys/types.h, BeBuild.h, SupportDefs.h:
  - Added types phys_[s]addr_t and respective printf() format macros.
  - Added public macros B_HAIKU_BITS, B_HAIKU_PHYSICAL_BITS,
    B_HAIKU_PHYSICAL_{32,64}_BIT.

Might break the build under older Haiku installations. Will test next.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-24 19:55:38 +00:00
Axel Dörfler ef9dbf80c1 * Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36218 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-13 13:36:53 +00:00
Ingo Weinhold 1f285441c3 Define B_GENERAL_ERROR_BASE to INT_MIN instead of LONG_MIN. On 32 bit
platforms it's the same value, but we actually want type int, not long.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36072 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-07 18:49:04 +00:00
Stephan Aßmus 2789b3911a Rewrote BAffineTransform to not be based on agg::trans_affine, which was pulling
in the AGG header. Reused the AGG code were applicable and implemented a lot
more features. The Multiply and PreMultiply meaning is reversed with respect to
AGG, but follows the mathematical meaning. Added type_code
B_AFFINE_TRANSFORM_TYPE to TypeConstants.h and let BAffineTransform derive from
BFlattenable.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35958 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-26 17:20:11 +00:00
Stephan Aßmus bbba047c2d * Added copy constructors.
* Let the AddHours(), Add*() return itself, so that they can be chained.
 * Made the previous *Name() methods static and added non-static versions that
   take the day/month of the object.
 * Make BDateTime::Date/Time() return references (const or non-const).
 * Fixed the BDateTime comparison operators.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35894 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-17 18:51:41 +00:00
Stephan Aßmus a070cf5306 * Indentation update in DateTime.h
* Extended BTime, BDate and BDateTime with archiving functionality.
 * Adjusted code which uses these classes, since including DateTime.h
   already imports the classes from the BPrivate namespace.
 * Moved DateTime.h into Support Kit. It is still in the BPrivate namespace,
   as I am uncertain what to do with time_type and diff_type. I'd favor
   moving the constants into the classes itself. Possibly removing the B_
   prefix from them. Feedback welcome.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35772 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-03-07 12:08:47 +00:00
Michael Lotz a5b7cbe331 Adding utf-8 aware version of most functions to BString. They are named after
the corresponding normal functions but have a "Chars" in the name like
"MoveCharsInto" or "AppendChars". Also added CountBytes() and CharAt().
This should make everyday string handling with multibyte strings a bit easier.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35371 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-02-01 04:20:01 +00:00
Ingo Weinhold 4f7b2c67b0 * gcc 4 features built-ins for atomic operations. If the macro
B_USE_BUILTIN_ATOMIC_FUNCTIONS is defined most atomic_*() functions are
  redefined as macros using the built-ins directly.
* Enabled that feature for the x86 build. Might work on other platforms as
  well, but that needs to be tested.

No significant speedup for the -j8 Haiku image build.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35018 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-11 21:38:07 +00:00
Ingo Weinhold 34a48c70ef Added type nanotime_t (an int64 storing a nanoseconds value) and function
system_time_nsecs(), returning the system time in nanoseconds. The function
is only really implemented for x86. For the other architectures
system_time() * 1000 is returned.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34543 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-07 21:43:19 +00:00
Stephan Aßmus b0850e9ba1 * Code and header indentation cleanup
* Added operator== and !=
 * Added check for list != this in operator=
 * Added HasItem() and IndexOf() versions that take const void*, duplicating
   the code, since I didn't want to introduce another function call in these
   potentially time critical methods.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34520 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-06 12:44:38 +00:00
Ingo Weinhold cf844822db * Added B_PRIdTIME and B_PRIiTIME macros (for time_t).
* Added FSSH_[S]SIZE_MAX to headers/private/fs_shell/fssh_types.h.
* Fixed various 64 bit compiler warnings. Nothing too serious, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34241 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-25 12:02:20 +00:00
Ingo Weinhold 0fde9192c9 Fixed indentation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34219 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 20:30:01 +00:00
Ingo Weinhold 2222d0559d * Introduced new header directory "config", which ATM contains HaikuConfig.h
and types.h. The idea is to provide a basic architecture/compiler
  abstraction by defining types and macros that allow the posix/ and os/
  headers to be mostly architecture/compiler agnostic. 
* Adjusted the posix/ and os/ headers accordingly.
* <SupportDefs.h>: Introduced B_PRI* and B_SCN* macros similar to the PRI*
  and SCN* macros defined in <inttypes.h>, just for the BeOS/Haiku [u]int*
  types and some POSIX types (e.g. off_t, dev_t, ino_t) that don't have POSIX
  macros. Also the B_PRI* and B_SCN* macros are available unconditionally,
  unlike the <inttypes.h> macros, which require __STDC_FORMAT_MACROS to be
  defined in C++ mode.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34214 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-11-24 19:44:07 +00:00
Axel Dörfler 0667145547 * Fixed indentation.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33370 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-30 12:36:21 +00:00
Michael Lotz ace6934d79 While the AutoLocker is not public at least make BAutolock a bit more useful by
also providing Lock() and Unlock(). Applied public header style.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33367 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-09-30 01:00:23 +00:00
Stephan Aßmus d4d27fac86 * Rewrote MediaDefs.h and MediaEncoder.h
* Moved MediaKit errors into Errors.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 12:42:36 +00:00
Stephan Aßmus 81506b0100 Optimized includes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32778 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 12:30:04 +00:00
Axel Dörfler d7571ebcf7 * Rewrote headers as needed.
* Cleaned up our own headers.
* Moved translator errors into Errors.h.
* Removed extra TranslationKit.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32755 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-27 14:20:56 +00:00
Ingo Weinhold c527fef824 Added type constant B_XATTR_TYPE. This is not a data type, but rather a marker
that can be used for node attributes, when those originate from Linux xattrs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32426 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 21:22:25 +00:00
Ingo Weinhold 7c44760049 Added ENOATTR.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32425 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-15 21:20:05 +00:00
Axel Dörfler e90b90daf6 * Added desperately missing Trim() method.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32035 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-31 21:13:19 +00:00
Ingo Weinhold 1746066cde * Made _Allocate() static.
* Moved the private inline methods up in the source file, so they can actually
  be inlined.
* UnlockBuffer(): Removed superfluous "if". Maybe the one who wrote it can have
  a look and check whether something else was intended originally.
* _MakeWritable() (both versions): Removed the superfluous ref count increment
  and the matching decrements.
* _Resize(): Fixed ref count ASSERT. It would always be triggered when called
  from UnlockBuffer(), since the ref count is -1 in that case.
* Clarified some comments.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31662 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-21 00:04:46 +00:00
Ingo Weinhold ff293f209a Added (const char*) cast operator. That makes BString more convenient to pass
around, particularly returning it from methods instead of a const char*, if the
object stores the string as a BString anyway, thus leveraging CoW.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31354 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-01 13:11:30 +00:00
Axel Dörfler e52400cf24 * Fixed a race condition in the former _Detach*() functions: since atomic_get()
was used, two different threads could decide to share the same mutable string.
* Renamed some functions to make clearer what they do, ie. _Detach() is now
  called _MakeWritable().
* Cleaned up some questionable semantics, like the const char* parameter in
  _DetachWith() - you can now choose to copy the original string or not with
  a boolean. This also makes sure that the string is actually copied when it
  has to, which wasn't the case before (but that was no problem with the way
  that function was used).
* Made the header compliant with our style guide.
* Further cleanup.
* All BString related unit tests are passed, so I guess I didn't break too
  much :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30980 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-06 11:23:17 +00:00
Ingo Weinhold 9073b0dccc Made _debuggerAssert()'s "message" parameter const. Fixes building with gcc4.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30502 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-30 12:21:20 +00:00
Ingo Weinhold 39d58e2f49 Experimental approach to tackle the problem with Be's negative error codes and
ported software:
* If the macro B_USE_POSITIVE_POSIX_ERRORS is defined the POSIX error code
  constants (ENOMEM, EINTR,...) will have positive values.
* Introduced the macros B_TO_{POSITIVE,NEGATIVE}_ERROR() which do convert a
  given error code to a positive/negative value.
* Added static library libposix_error_mapper.a that overrides all POSIX
  functions (save the ones I forgot to add :-)) directly meddling with error
  codes (having them as parameter or returning them) dealing with the
  positive<->negative error code conversions. The functions have hidden
  visibility, so they affect only the shared object they are linked into.
* So ideally all one has to do is to build a ported software with
  -DB_USE_POSITIVE_POSIX_ERRORS and -lposix_error_mapper and be good with
  respect to error code problems.
* Potential issues:
  - When mixing ported and Haiku native code, i.e. using Haiku native code in
    a ported software or using a ported library in a Haiku native application
    care must be taken to convert error codes where the two interface. That's
    what the B_TO_{POSITIVE,NEGATIVE}_ERROR() macros are supposed to be used
    for.
  - A ported static library can obviously not be linked directly against
    -lposix_error_mapper. The shared object linking a against the ported static
    library has to do that. The previous point applies when that causes mixing
    with Haiku native code.
  - When dependent ported libraries are used probably all of them should use
    the error mapping.

Comments welcome.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29653 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-22 15:43:03 +00:00
Ingo Weinhold f451e14bc2 Added InitCheck() method.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29487 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-13 02:05:10 +00:00
Axel Dörfler 1b21be7091 * BBufferIO did not implement Seek() and Position() correctly; it just passed
it to the stream. This caused Read()/Write() to need two syscalls for nothing
  (this only caused the actual stream to share the same position with the
  BBufferIO, something you just cannot rely on when using buffered I/O).
* Anyway, this reduces the time VirtualBox needs to open some RAW test images
  from over 4 minutes to less than 15 seconds...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28662 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-16 21:23:45 +00:00
Stephan Aßmus e1f3108a60 Patch by Scott:
Make sure the comments are C style in headers that are included by POSIX
headers.

Thanks! Should fix #2870.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28598 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-11-10 23:50:42 +00:00
Maurice Kalinowski 53779f07a4 fix gcc4 warning about wrong argument type.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25967 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-15 19:21:00 +00:00
Rene Gollent 0c8bdbafd5 Revamp BList somewhat to further optimize the resizing behavior.
We now keep track of a lower bound as to when the list should scale
itself back down. When increasing the list size, we double the current,
with the lower bound set to 1/4 of the current size, not allowing it to
go any smaller than the block size. These combined allow us to do very
cheap tests to see if an operation requires a resize at all, and minimize
how often the list actually needs to be resized, since the difference in upper
and lower bounds prevents bouncing back and forth between a size in the case
of adding/removing an item while close to a boundary. All in all this should
make BList noticably more scalable when doing large numbers of add/remove
operations.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25946 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-06-12 21:30:28 +00:00
Ingo Weinhold 965aa03f49 Changed all error codes from enum values to macros. This allows for
compile time checks. Incidently those are not totally uncommon in
portable code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25385 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-05-08 20:54:14 +00:00
Axel Dörfler 4b83262008 * _Realloc() did not initialize the reference count either.
* _Alloc() can now preserve the original reference count, only _Clone()
  still initializes it to 1. As Karsten pointed out, this is necessary to
  preserve the "shareable" status of the private data.
* I hope that's finally it. What happened to our testing suite, anyway? :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24355 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-10 22:56:27 +00:00
Axel Dörfler bf4ddb61e1 * As found by Karsten, the reference count was not initialized in
_ReplaceAtPositions(), and _DoCharacterEscape() (we don't need to preserve
  it, though, as it must be 1).
* Factored out an _Alloc() method which is now always called when the private
  data is allocated. It also takes care of correct initialization (and thus
  fixes the above problem).
* This fix finally allows turning on reference counting again, thanks Karsten!
* Minor cleanup, renamed "oldAdr"/"newAdr" to "oldString", resp. "newString".


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24348 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-10 19:14:05 +00:00
Axel Dörfler 688c14266c * After my last change, _IsShareable() was called on the wrong string in the
copy constructors, effectively turning of references completely.
* Since that caused troubles (NetPositive now crashes when started), I
  temporarily disabled references by letting _IsShareable() always return
  false until the issue is resolved.
* _FreePrivateData() now sets the fPrivateData member to NULL, and is also
  safe to be called when fPrivateData is NULL.
* Removed my comment about the threading problem in _Detach() and _DetachWith()
  as that just couldn't happen.
* _Clone() must not use memcpy() as the string pointed to by "data" might not
  be as long as "length".
* LockBuffer() now marks a string as unshareable.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24345 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-10 14:14:44 +00:00
Axel Dörfler 002b33b720 * Fixed a bunch or concurreny bugs and memory leaks of the new reference
string stuff.
* It's still not thread-safe for all usage patterns, though, so we might want
  to remove or disable it: if a string is shared between several threads, and
  one of those starts to use a reference, all kinds of problems can happen.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24312 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-08 19:05:09 +00:00
Karsten Heimrich 93608e10d1 * fixed coding style...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24103 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-24 22:22:43 +00:00
Stefano Ceccherini 576e2bf833 Patch by Julun: implements a refcounted BString. Thank You!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24102 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-02-24 21:16:58 +00:00
Axel Dörfler f6e4cbb952 * Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 20:13:55 +00:00
Jérôme Duval 5d5a6848b5 added printf format attributes for gcc
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21592 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-07-11 18:55:27 +00:00
Axel Dörfler 9c62a6ed7d Rewritten Debug.h by Vasilis Kaoutsis.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20473 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-30 14:43:25 +00:00
Ingo Weinhold 2c97a8d164 Use -I instead of -isystem for system header directories when building
with gcc 4. Fixed resulting build errors (gcc is more lenient for
headers in -isystem directories).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20386 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-03-14 20:36:42 +00:00
Ingo Weinhold 24f10d18b1 Added missing B_ATOM_TYPE AND B_ATOMREF_TYPE.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20212 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-23 23:16:31 +00:00
Axel Dörfler 4a50aa51f2 Applied another patch by Vasilis: this one replaces all C++ style comments with
C style ones, as this is a C header, too (and a very basic one).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19984 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-27 16:26:37 +00:00
Axel Dörfler 686bdd59d3 Rewritten Errors.h, courtesy of Vasilis Kaoutsis - thanks for all the work!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19979 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-26 22:11:00 +00:00
Axel Dörfler 087882c26e * Rewrote headers as necessary; only Errors.h and Debug.h still originate from a Be header now;
feel free to change that ;-)
* Cleaned up existing headers.
* Coding style guide update to BBufferIO (renamed m_* members to f*).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-26 16:36:29 +00:00
Axel Dörfler 43cca04a9a Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19731 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-01-06 18:06:38 +00:00
Axel Dörfler bae87c9140 Added a new type for the vector icon format 'VICN' or B_VECTOR_ICON_TYPE.
It's hopefully now used everywhere instead of B_RAW_TYPE where appropriate.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19219 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-07 02:46:25 +00:00
Ingo Weinhold 9ecf9d1c1d Merge from layout management branch.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18649 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-26 16:21:15 +00:00
Bruno G. Albuquerque 92c6f0417b How could we live without this?
Added B_DONT_DO_THAT error define.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18256 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-07-24 22:52:56 +00:00
Axel Dörfler 64f10d7d89 Cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17981 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-30 12:40:15 +00:00
Jérôme Duval 6c61b2841f moved B_PROPERTY_INFO_TYPE definition to TypeConstants.h
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17907 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-22 12:21:46 +00:00
Stephan Aßmus 39c991c0f3 Added BPositionIO::GetSize() and implemented it by means of Seek() and
Position(). This used up a virtual slot of BPositionIO. GetSize() needed to be
implemented in BFile, which uses the BStatable version as before. This should
hopefully be binary compatible. The only problem could be in source
compatibility when there are classes inheriting from BPositionIO implementing
their own GetSize().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17593 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-26 13:27:53 +00:00
Axel Dörfler b2b2b75a41 Fixed some style issues. Happy recompiling! :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17092 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-11 18:50:48 +00:00
Axel Dörfler 31dc79a18b * Added B_MINI_ICON_TYPE and B_LARGE_ICON_TYPE to TypeConstants.h.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16996 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-04 01:30:03 +00:00
Ingo Weinhold 338b8dc301 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
2005-10-29 16:27:43 +00:00
Ingo Weinhold a406236dc2 New error codes:
- B_SHUTDOWN_CANCELLED: The shutdown process was cancelled (most likely by
  the user).
- B_SHUTTING_DOWN: An operation cannot be performed, since the system is
  shutting down (e.g. BApplication creation).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13413 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-03 16:50:29 +00:00
Axel Dörfler 09b83e5cec Removed the obsolete byteorder.h header (it just included ByteOrder.h).
Fixed the remaining references to that header in our repository.
Note, this might break source compatibility - please update your sources :-)
Slightly converted UBS_audio_utils.c to use our style guide while I were at it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12827 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-26 08:12:59 +00:00
Axel Dörfler ec5a9998df Added a B_NOT_SUPPORTED synonym for EOPNOTSUPP.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12250 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-05 13:56:16 +00:00
Axel Dörfler ae614d48fc Some minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12242 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-04 23:00:48 +00:00
Axel Dörfler 61ad5bc2e7 Fixed various problems with the latest stdbool.h changes, including stdbool.h itself:
- SupportDefs.h only includes stdbool.h if included from C
- stdbool.h for C++ now includes a macro for "bool" as defined by that header
- stdbool.h does nothing if __bool_true_false_are_defined is already defined
- stdbool.h no longer defines a _Bool enum, but defines _Bool as unsigned char, as
  previously done by SupportDefs.h (the previous version changed the size).
- The gensyscalls Jamfile now preprocesses its headers in C++ mode so that "bool"
  stays "bool", and doesn't become _Bool.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12042 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-26 18:01:40 +00:00
Jérôme Duval aab32edf08 updated stdbool.h
SupportDefs.h now includes stdbool.h
This can break in some cases


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11985 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-25 17:08:27 +00:00