Style fixes to Support Kit files

This commit is contained in:
John Scipione
2014-06-24 19:30:54 -04:00
parent 2661ce4605
commit 29e8fa5922
37 changed files with 268 additions and 248 deletions
+5 -11
View File
@@ -1,9 +1,9 @@
/*
* Copyright 2013, Haiku, Inc. All Rights Reserved.
* Copyright 2013-2014 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SUPPORT_ARCHITECTURE_H
#define _SUPPORT_ARCHITECTURE_H
#ifndef _ARCHITECTURE_H
#define _ARCHITECTURE_H
#include <sys/cdefs.h>
@@ -13,7 +13,6 @@
__BEGIN_DECLS
const char* get_architecture();
const char* get_primary_architecture();
size_t get_secondary_architectures(const char** architectures,
@@ -21,22 +20,17 @@ size_t get_secondary_architectures(const char** architectures,
size_t get_architectures(const char** architectures, size_t count);
const char* guess_architecture_for_path(const char* path);
__END_DECLS
/* C++ API */
#ifdef __cplusplus
#include <StringList.h>
status_t get_secondary_architectures(BStringList& _architectures);
status_t get_architectures(BStringList& _architectures);
#endif /* __cplusplus */
#endif
#endif /* _SUPPORT_ARCHITECTURE_H */
#endif /* _ARCHITECTURE_H */
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2010, Haiku, Inc. All Rights Reserved.
* Copyright 2001-2010 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _ARCHIVABLE_H
+4 -3
View File
@@ -2,8 +2,8 @@
* Copyright 2001-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SUPPORT_AUTOLOCK_H
#define _SUPPORT_AUTOLOCK_H
#ifndef _AUTOLOCK_H
#define _AUTOLOCK_H
#include <Locker.h>
@@ -101,4 +101,5 @@ BAutolock::Unlock()
fLocker->Unlock();
}
#endif // _SUPPORT_AUTOLOCK_H
#endif // _AUTOLOCK_H
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Copyright 2007-2014 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _BEEP_H
@@ -17,6 +17,6 @@ status_t beep();
status_t system_beep(const char* eventName);
status_t add_system_beep_event(const char* eventName, uint32 flags = 0);
#endif
#endif // __cplusplus
#endif // _BEEP_H
+1
View File
@@ -61,4 +61,5 @@ class BBlockCache {
uint32 _reserved[2];
};
#endif // _BLOCK_CACHE_H
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2007-2010, Haiku, Inc. All Rights Reserved.
* Copyright 2007-2010 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _BUFFER_IO_H
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2011, Haiku, Inc. All Rights Reserved.
* Copyright 2011 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _BUFFERED_DATA_IO_H
+6 -6
View File
@@ -1,9 +1,9 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Copyright 2007 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _BYTEORDER_H
#define _BYTEORDER_H
#ifndef _BYTE_ORDER_H
#define _BYTE_ORDER_H
#include <BeBuild.h>
@@ -111,7 +111,7 @@ typedef enum {
#ifdef __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
extern status_t swap_data(type_code type, void *data, size_t length,
swap_action action);
@@ -132,6 +132,6 @@ extern uint16 __swap_int16(uint16 arg);
#ifdef __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* _BYTEORDER_H */
#endif /* _BYTE_ORDER_H */
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Copyright 2007 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _CLASS_INFO_H
@@ -20,5 +20,5 @@
(dynamic_cast<class*>(object) != NULL)
#define is_instance_of(object, class) \
(typeid(*(object)) == typeid(class))
#endif // _CLASS_INFO_H
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2005-2014, Haiku, Inc. All rights reserved.
* Copyright 2005-2014 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _DATA_IO_H
+4 -7
View File
@@ -1,9 +1,9 @@
/*
* Copyright 2007-2010, Haiku, Inc. All Rights Reserved.
* Copyright 2007-2010 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _DATE_TIME_H_
#define _DATE_TIME_H_
#ifndef _DATE_TIME_H
#define _DATE_TIME_H
#include <String.h>
@@ -14,7 +14,6 @@ class BMessage;
namespace BPrivate {
enum time_type {
B_GMT_TIME,
B_LOCAL_TIME
@@ -206,10 +205,8 @@ private:
BTime fTime;
};
} // namespace BPrivate
using BPrivate::time_type;
using BPrivate::B_GMT_TIME;
using BPrivate::B_LOCAL_TIME;
@@ -224,4 +221,4 @@ using BPrivate::BDate;
using BPrivate::BDateTime;
#endif // _DATE_TIME_H_
#endif // _DATE_TIME_H
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Copyright 2007 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _DEBUG_H
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2007-2014, Haiku, Inc. All Rights Reserved.
* Copyright 2007-2014 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _ERRORS_H
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2007-2010, Haiku, Inc. All Rights Reserved.
* Copyright 2007-2010 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FLATTENABLE_H
+6 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2009, Haiku, Inc. All Rights Reserved.
* Copyright 2001-2009 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _BE_LIST_H
@@ -12,14 +12,14 @@
class BList {
public:
BList(int32 count = 20);
BList(const BList& anotherList);
BList(const BList& other);
virtual ~BList();
BList& operator=(const BList& other);
bool operator==(const BList& other) const;
bool operator!=(const BList& other) const;
// Adding and removing items.
// Adding and removing items
bool AddItem(void* item, int32 index);
bool AddItem(void* item);
bool AddList(const BList* list, int32 index);
@@ -28,7 +28,7 @@ public:
bool RemoveItem(void* item);
void* RemoveItem(int32 index);
bool RemoveItems(int32 index, int32 count);
bool ReplaceItem(int32 index, void* newItem);
bool ReplaceItem(int32 index, void* item);
void MakeEmpty();
@@ -36,7 +36,7 @@ public:
void SortItems(int (*compareFunc)(const void*,
const void*));
bool SwapItems(int32 indexA, int32 indexB);
bool MoveItem(int32 fromIndex, int32 toIndex);
bool MoveItem(int32 from, int32 to);
// Retrieve items
void* ItemAt(int32 index) const;
@@ -76,4 +76,5 @@ private:
uint32 _reserved[1];
};
#endif // _BE_LIST_H
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2001-2010, Haiku, Inc. All Rights Reserved.
* Copyright 2001-2010 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _LOCKER_H
+16 -13
View File
@@ -51,11 +51,12 @@ template<class T> class BObjectList;
template<class T>
struct UnaryPredicate {
virtual int operator()(const T *) const
// virtual could be avoided here if FindBinaryInsertionIndex,
// etc. were member template functions
{ return 0; }
{
return 0;
}
private:
static int _unary_predicate_glue(const void *item, void *context);
@@ -112,7 +113,6 @@ protected:
template<class T>
class BObjectList : private _PointerList_ {
public:
// iteration and sorting
typedef T* (*EachFunction)(T*, void*);
typedef const T* (*ConstEachFunction)(const T*, void*);
@@ -424,7 +424,7 @@ BObjectList<T>::BObjectList(int32 itemsPerBlock, bool owning)
template<class T>
BObjectList<T>::BObjectList(const BObjectList<T> &list)
BObjectList<T>::BObjectList(const BObjectList<T>& list)
:
_PointerList_(list)
{
@@ -483,25 +483,25 @@ BObjectList<T>::AddItem(T* item)
template<class T>
bool
BObjectList<T>::AddItem(T* item, int32 atIndex)
BObjectList<T>::AddItem(T* item, int32 index)
{
return _PointerList_::AddItem((void*)item, atIndex);
return _PointerList_::AddItem((void*)item, index);
}
template<class T>
bool
BObjectList<T>::AddList(BObjectList<T>* newItems)
BObjectList<T>::AddList(BObjectList<T>* list)
{
return _PointerList_::AddList(newItems);
return _PointerList_::AddList(list);
}
template<class T>
bool
BObjectList<T>::AddList(BObjectList<T>* newItems, int32 atIndex)
BObjectList<T>::AddList(BObjectList<T>* list, int32 index)
{
return _PointerList_::AddList(newItems, atIndex);
return _PointerList_::AddList(list, index);
}
@@ -540,16 +540,18 @@ BObjectList<T>::ReplaceItem(int32 index, T* item)
{
if (owning)
delete ItemAt(index);
return _PointerList_::ReplaceItem(index, (void*)item);
}
template<class T>
T*
BObjectList<T>::SwapWithItem(int32 index, T* newItem)
BObjectList<T>::SwapWithItem(int32 index, T* item)
{
T* result = ItemAt(index);
_PointerList_::ReplaceItem(index, (void*)newItem);
_PointerList_::ReplaceItem(index, (void*)item);
return result;
}
@@ -712,6 +714,7 @@ BObjectList<T>::BinarySearch(const T& key, CompareFunction func) const
return (T*)_PointerList_::BinarySearch(&key, (GenericCompareFunction)func);
}
template<class T>
T*
BObjectList<T>::BinarySearch(const T& key, CompareFunctionWithState func,
@@ -942,4 +945,4 @@ BObjectList<T>::BinaryInsertUnique(T* item, const UnaryPredicate<T>& pred)
}
#endif /* _OBJECT_LIST_H */
#endif // _OBJECT_LIST_H
+25 -24
View File
@@ -1,9 +1,9 @@
/*
* Copyright 2001-2010, Haiku Inc. All Rights Reserved.
* Copyright 2001-2010 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef __BSTRING__
#define __BSTRING__
#ifndef _B_STRING_H
#define _B_STRING_H
#include <stdarg.h>
@@ -383,7 +383,7 @@ private:
// Escape
BString& _DoCharacterEscape(const char* string,
const char *setOfCharsToEscape, char escapeChar);
const char* setOfCharsToEscape, char escapeChar);
BString& _DoCharacterDeescape(const char* string,
char escapeChar);
@@ -426,7 +426,7 @@ BString::Length() const
{
// the most significant bit is reserved; accessing
// it in any way will cause the computer to explode
return fPrivateData ? (*(((int32 *)fPrivateData) - 1) & 0x7fffffff) : 0;
return fPrivateData ? (*(((int32*)fPrivateData) - 1) & 0x7fffffff) : 0;
}
@@ -453,7 +453,7 @@ BString::HashValue() const
}
inline BString &
inline BString&
BString::SetTo(const char* string)
{
return operator=(string);
@@ -476,23 +476,23 @@ BString::ByteAt(int32 index) const
}
inline BString &
BString::operator+=(const BString &string)
inline BString&
BString::operator+=(const BString& string)
{
_DoAppend(string.String(), string.Length());
return *this;
}
inline BString &
BString::Append(const BString &string)
inline BString&
BString::Append(const BString& string)
{
_DoAppend(string.String(), string.Length());
return *this;
}
inline BString &
inline BString&
BString::Append(const char* string)
{
return operator+=(string);
@@ -500,42 +500,42 @@ BString::Append(const char* string)
inline bool
BString::operator==(const BString &string) const
BString::operator==(const BString& string) const
{
return strcmp(String(), string.String()) == 0;
}
inline bool
BString::operator<(const BString &string) const
BString::operator<(const BString& string) const
{
return strcmp(String(), string.String()) < 0;
}
inline bool
BString::operator<=(const BString &string) const
BString::operator<=(const BString& string) const
{
return strcmp(String(), string.String()) <= 0;
}
inline bool
BString::operator>=(const BString &string) const
BString::operator>=(const BString& string) const
{
return strcmp(String(), string.String()) >= 0;
}
inline bool
BString::operator>(const BString &string) const
BString::operator>(const BString& string) const
{
return strcmp(String(), string.String()) > 0;
}
inline bool
BString::operator!=(const BString &string) const
BString::operator!=(const BString& string) const
{
return strcmp(String(), string.String()) != 0;
}
@@ -556,42 +556,42 @@ BString::operator const char*() const
inline bool
operator<(const char *str, const BString &string)
operator<(const char* str, const BString& string)
{
return string > str;
}
inline bool
operator<=(const char *str, const BString &string)
operator<=(const char* str, const BString& string)
{
return string >= str;
}
inline bool
operator==(const char *str, const BString &string)
operator==(const char* str, const BString& string)
{
return string == str;
}
inline bool
operator>(const char *str, const BString &string)
operator>(const char* str, const BString& string)
{
return string < str;
}
inline bool
operator>=(const char *str, const BString &string)
operator>=(const char* str, const BString& string)
{
return string <= str;
}
inline bool
operator!=(const char *str, const BString &string)
operator!=(const char* str, const BString& string)
{
return string != str;
}
@@ -618,4 +618,5 @@ private:
int32 fPosition;
};
#endif // __BSTRING__
#endif // _B_STRING_H
+4 -4
View File
@@ -1,9 +1,9 @@
/*
* Copyright 2011, Haiku, Inc. All Rights Reserved.
* Copyright 2011 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SUPPORT_BSTRING_LIST_H_
#define _SUPPORT_BSTRING_LIST_H_
#ifndef _STRING_LIST_H
#define _STRING_LIST_H
#include <BeBuild.h>
@@ -100,4 +100,4 @@ BStringList::operator!=(const BStringList& other) const
}
#endif // _SUPPORT_BSTRING_LIST_H_
#endif // _STRING_LIST_H
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2010, Haiku, Inc. All Rights Reserved.
* Copyright 2004-2010 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Author:
+6 -6
View File
@@ -1,9 +1,9 @@
/*
* Copyright 2003-2007, Haiku, Inc. All Rights Reserved.
* Copyright 2003-2007 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _TLS_H
#define _TLS_H
#define _TLS_H
#include <BeBuild.h>
@@ -19,7 +19,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
extern int32 tls_allocate(void);
@@ -54,16 +54,16 @@ tls_set(int32 index, void *value)
: : "r" (index), "r" (value));
}
#else
#else /* !_NO_INLINE_ASM && __INTEL__ && __GNUC__ */
extern void *tls_get(int32 index);
extern void **tls_address(int32 index);
extern void tls_set(int32 index, void *value);
#endif
#endif /* !_NO_INLINE_ASM && __INTEL__ && __GNUC__ */
#ifdef __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* _TLS_H */
+31 -17
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010, Haiku, Inc. All Rights Reserved.
* Copyright 2005-2010 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Author:
@@ -63,23 +63,37 @@ enum {
B_NETWORK_ADDRESS_TYPE = 'NWAD',
B_MIME_STRING_TYPE = 'MIMS',
// deprecated, do not use
B_ASCII_TYPE = 'TEXT' // use B_STRING_TYPE instead
/* deprecated, do not use */
B_ASCII_TYPE = 'TEXT'
/* use B_STRING_TYPE instead */
};
// System-wide MIME types for handling URL's
/* System-wide MIME types for handling URL's */
extern const char *B_URL_HTTP; // application/x-vnd.Be.URL.http
extern const char *B_URL_HTTPS; // application/x-vnd.Be.URL.https
extern const char *B_URL_FTP; // application/x-vnd.Be.URL.ftp
extern const char *B_URL_GOPHER; // application/x-vnd.Be.URL.gopher
extern const char *B_URL_MAILTO; // application/x-vnd.Be.URL.mailto
extern const char *B_URL_NEWS; // application/x-vnd.Be.URL.news
extern const char *B_URL_NNTP; // application/x-vnd.Be.URL.nntp
extern const char *B_URL_TELNET; // application/x-vnd.Be.URL.telnet
extern const char *B_URL_RLOGIN; // application/x-vnd.Be.URL.rlogin
extern const char *B_URL_TN3270; // application/x-vnd.Be.URL.tn3270
extern const char *B_URL_WAIS; // application/x-vnd.Be.URL.wais
extern const char *B_URL_FILE; // application/x-vnd.Be.URL.file
extern const char* B_URL_HTTP;
/* application/x-vnd.Be.URL.http */
extern const char* B_URL_HTTPS;
/* application/x-vnd.Be.URL.https */
extern const char* B_URL_FTP;
/* application/x-vnd.Be.URL.ftp */
extern const char* B_URL_GOPHER;
/* application/x-vnd.Be.URL.gopher */
extern const char* B_URL_MAILTO;
/* application/x-vnd.Be.URL.mailto */
extern const char* B_URL_NEWS;
/* application/x-vnd.Be.URL.news */
extern const char* B_URL_NNTP;
/* application/x-vnd.Be.URL.nntp */
extern const char* B_URL_TELNET;
/* application/x-vnd.Be.URL.telnet */
extern const char* B_URL_RLOGIN;
/* application/x-vnd.Be.URL.rlogin */
extern const char* B_URL_TN3270;
/* application/x-vnd.Be.URL.tn3270 */
extern const char* B_URL_WAIS;
/* application/x-vnd.Be.URL.wais */
extern const char* B_URL_FILE;
/* application/x-vnd.Be.URL.file */
#endif // _TYPE_CONSTANTS_H
#endif /* _TYPE_CONSTANTS_H */
+20 -20
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2007, Haiku, Inc. All Rights Reserved.
* Copyright 2007 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _UTF8_H
@@ -11,9 +11,9 @@
#include <SupportDefs.h>
// Conversion Flavors
/* Conversion Flavors */
enum {
B_ISO1_CONVERSION, // ISO 8859-x
B_ISO1_CONVERSION, /* ISO 8859-x */
B_ISO2_CONVERSION,
B_ISO3_CONVERSION,
B_ISO4_CONVERSION,
@@ -23,28 +23,28 @@ enum {
B_ISO8_CONVERSION,
B_ISO9_CONVERSION,
B_ISO10_CONVERSION,
B_MAC_ROMAN_CONVERSION, // Macintosh Roman
B_SJIS_CONVERSION, // Shift-JIS
B_EUC_CONVERSION, // EUC Packed Japanese
B_JIS_CONVERSION, // JIS X 0208-1990
B_MS_WINDOWS_CONVERSION, // Windows Latin-1 Codepage 1252
B_UNICODE_CONVERSION, // Unicode 2.0, UCS-2
B_KOI8R_CONVERSION, // KOI8-R
B_MS_WINDOWS_1251_CONVERSION, // Windows Cyrillic Codepage 1251
B_MS_DOS_866_CONVERSION, // MS-DOS Codepage 866
B_MS_DOS_CONVERSION, // MS-DOS Codepage 437
B_EUC_KR_CONVERSION, // EUC Korean
B_MAC_ROMAN_CONVERSION, /* Macintosh Roman */
B_SJIS_CONVERSION, /* Shift-JIS */
B_EUC_CONVERSION, /* EUC Packed Japanese */
B_JIS_CONVERSION, /* JIS X 0208-1990 */
B_MS_WINDOWS_CONVERSION, /* Windows Latin-1 Codepage 1252 */
B_UNICODE_CONVERSION, /* Unicode 2.0, UCS-2 */
B_KOI8R_CONVERSION, /* KOI8-R */
B_MS_WINDOWS_1251_CONVERSION, /* Windows Cyrillic Codepage 1251 */
B_MS_DOS_866_CONVERSION, /* MS-DOS Codepage 866 */
B_MS_DOS_CONVERSION, /* MS-DOS Codepage 437 */
B_EUC_KR_CONVERSION, /* EUC Korean */
B_ISO13_CONVERSION,
B_ISO14_CONVERSION,
B_ISO15_CONVERSION,
B_BIG5_CONVERSION, // Chinese Big5
B_GBK_CONVERSION, // Chinese GB18030
B_UTF16_CONVERSION, // Unicode UTF-16
B_MS_WINDOWS_1250_CONVERSION // Windows Central European Codepage
B_BIG5_CONVERSION, /* Chinese Big5 */
B_GBK_CONVERSION, /* Chinese GB18030 */
B_UTF16_CONVERSION, /* Unicode UTF-16 */
B_MS_WINDOWS_1250_CONVERSION /* Windows Central European Codepage */
};
// Conversion Functions
/* Conversion Functions */
#ifdef __cplusplus
@@ -56,6 +56,6 @@ status_t convert_from_utf8(uint32 destEncoding, const char* source,
int32* sourceLength, char* dest, int32* destLength, int32* state,
char substitute = B_SUBSTITUTE);
#endif
#endif /* __cplusplus */
#endif /* _UTF8_H */
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2003-2007, Haiku, Inc. All Rights Reserved.
* Copyright 2003-2007 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _PARSEDATE_H
@@ -19,7 +19,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
extern time_t parsedate(const char *dateString, time_t now);
extern time_t parsedate_etc(const char *dateString, time_t now, int *_storedFlags);
@@ -29,6 +29,6 @@ extern const char **get_dateformats(void);
#ifdef __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* _PARSEDATE_H */