diff --git a/headers/private/shared/OpenHashTable.h b/headers/private/shared/OpenHashTable.h index 875ed02695..dadd48a98e 100644 --- a/headers/private/shared/OpenHashTable.h +++ b/headers/private/shared/OpenHashTable.h @@ -46,7 +46,7 @@ All rights reserved. #define __OPEN_HASH_TABLE__ #include -#include +#include // don't include #define ASSERT(E) (void)0 diff --git a/src/add-ons/input_server/devices/wacom/MasterServerDevice.cpp b/src/add-ons/input_server/devices/wacom/MasterServerDevice.cpp index 9bb05dcb93..0300fff754 100644 --- a/src/add-ons/input_server/devices/wacom/MasterServerDevice.cpp +++ b/src/add-ons/input_server/devices/wacom/MasterServerDevice.cpp @@ -4,7 +4,7 @@ */ #include "MasterServerDevice.h" -#include +#include #include #include #include diff --git a/src/add-ons/kernel/network/protocols/ipv4/multicast.h b/src/add-ons/kernel/network/protocols/ipv4/multicast.h index 7b98498fd4..5a6129b7e2 100644 --- a/src/add-ons/kernel/network/protocols/ipv4/multicast.h +++ b/src/add-ons/kernel/network/protocols/ipv4/multicast.h @@ -133,7 +133,7 @@ public: typedef HashTableLink HashLink; typedef typename Addressing::AddressType AddressType; typedef MulticastFilter Filter; - typedef AddressSet AddressSet; + typedef ::AddressSet AddressSet; enum FilterMode { kInclude, diff --git a/src/add-ons/kernel/network/protocols/udp/udp.cpp b/src/add-ons/kernel/network/protocols/udp/udp.cpp index efc6d46a45..17c9d7691c 100644 --- a/src/add-ons/kernel/network/protocols/udp/udp.cpp +++ b/src/add-ons/kernel/network/protocols/udp/udp.cpp @@ -96,7 +96,7 @@ public: bool IsActive() const { return fActive; } void SetActive(bool newValue) { fActive = newValue; } - HashTableLink *HashTableLink() { return &fLink; } + ::HashTableLink *HashTableLink() { return &fLink; } private: UdpDomainSupport *fManager; @@ -143,7 +143,7 @@ struct UdpHashDefinition { && endpoint->PeerAddress().EqualTo(key.second, true); } - HashTableLink *GetLink(UdpEndpoint *endpoint) const + ::HashTableLink *GetLink(UdpEndpoint *endpoint) const { return endpoint->HashTableLink(); } diff --git a/src/add-ons/kernel/network/protocols/unix/UnixEndpoint.h b/src/add-ons/kernel/network/protocols/unix/UnixEndpoint.h index 056a0c76a3..07c7e11f0f 100644 --- a/src/add-ons/kernel/network/protocols/unix/UnixEndpoint.h +++ b/src/add-ons/kernel/network/protocols/unix/UnixEndpoint.h @@ -90,7 +90,7 @@ public: return fAddress; } - HashTableLink* HashTableLink() + ::HashTableLink* HashTableLink() { return &fAddressHashLink; } diff --git a/src/add-ons/mail_daemon/inbound_filters/match_header/StringMatcher.cpp b/src/add-ons/mail_daemon/inbound_filters/match_header/StringMatcher.cpp index 21adf0ac1b..9feada8ec8 100644 --- a/src/add-ons/mail_daemon/inbound_filters/match_header/StringMatcher.cpp +++ b/src/add-ons/mail_daemon/inbound_filters/match_header/StringMatcher.cpp @@ -1,7 +1,7 @@ //--------This file shamelessly stolen from Jeremy Friesner's excellent MUSCLE--------- /* This file is Copyright 2000 Level Control Systems. See the included LICENSE.txt file for details. */ -#include +#include #include #include "StringMatcher.h" diff --git a/src/add-ons/media/plugins/ogg/OggSeekable.cpp b/src/add-ons/media/plugins/ogg/OggSeekable.cpp index 33831817aa..a43f710c31 100644 --- a/src/add-ons/media/plugins/ogg/OggSeekable.cpp +++ b/src/add-ons/media/plugins/ogg/OggSeekable.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #define TRACE_THIS 0 #if TRACE_THIS diff --git a/src/add-ons/media/plugins/ogg/OggStream.cpp b/src/add-ons/media/plugins/ogg/OggStream.cpp index 212f1d9724..0fe267d711 100644 --- a/src/add-ons/media/plugins/ogg/OggStream.cpp +++ b/src/add-ons/media/plugins/ogg/OggStream.cpp @@ -6,6 +6,7 @@ #include "OggFormats.h" #include #include +#include #define TRACE_THIS 0 #if TRACE_THIS diff --git a/src/add-ons/media/plugins/ogg/OggTrack.cpp b/src/add-ons/media/plugins/ogg/OggTrack.cpp index 92a5ac9311..525ba6d232 100644 --- a/src/add-ons/media/plugins/ogg/OggTrack.cpp +++ b/src/add-ons/media/plugins/ogg/OggTrack.cpp @@ -1,5 +1,6 @@ #include "OggTrack.h" #include +#include #define TRACE_THIS 0 #if TRACE_THIS diff --git a/src/add-ons/print/transports/ipp/IppSetupDlg.cpp b/src/add-ons/print/transports/ipp/IppSetupDlg.cpp index 49838b285e..f3f82c4467 100644 --- a/src/add-ons/print/transports/ipp/IppSetupDlg.cpp +++ b/src/add-ons/print/transports/ipp/IppSetupDlg.cpp @@ -1,203 +1,205 @@ -// Sun, 18 Jun 2000 -// Y.Takagi - -#include -#include -#include -#include -#include -#include - -#include "URL.h" -#include "IppContent.h" -#include "IppURLConnection.h" -#include "IppSetupDlg.h" -#include "IppDefs.h" -#include "DbgMsg.h" - -#define DLG_WIDTH 350 -#define DLG_HEIGHT 80 - -#define BUTTON_WIDTH 70 -#define BUTTON_HEIGHT 20 - -#define URL_H 10 -#define URL_V 10 -#define URL_WIDTH (DLG_WIDTH - URL_H - URL_H) -#define URL_HEIGHT 20 -#define URL_TEXT "URL" - -#define OK_H (DLG_WIDTH - BUTTON_WIDTH - 11) -#define OK_V (DLG_HEIGHT - BUTTON_HEIGHT - 11) -#define OK_TEXT "OK" - -#define CANCEL_H (OK_H - BUTTON_WIDTH - 12) -#define CANCEL_V OK_V -#define CANCEL_TEXT "Cancel" - - -const BRect URL_RECT( - URL_H, - URL_V, - URL_H + URL_WIDTH, - URL_V + URL_HEIGHT); - -const BRect OK_RECT( - OK_H, - OK_V, - OK_H + BUTTON_WIDTH, - OK_V + BUTTON_HEIGHT); - -const BRect CANCEL_RECT( - CANCEL_H, - CANCEL_V, - CANCEL_H + BUTTON_WIDTH, - CANCEL_V + BUTTON_HEIGHT); - -enum MSGS { - M_CANCEL = 1, - M_OK -}; - - -class IppSetupView : public BView { -public: - IppSetupView(BRect, BDirectory *); - ~IppSetupView() {} - virtual void AttachedToWindow(); - bool UpdateViewData(); - -private: - BTextControl *url; - BDirectory *dir; -}; - -IppSetupView::IppSetupView(BRect frame, BDirectory *d) - : BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW), dir(d) -{ - SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); -} - -void IppSetupView::AttachedToWindow() -{ - /* url box */ - - url = new BTextControl(URL_RECT, "", URL_TEXT, "", NULL); - AddChild(url); - url->SetDivider(StringWidth(URL_TEXT) + 10); - - /* cancel */ - - BButton *button = new BButton(CANCEL_RECT, "", CANCEL_TEXT, new BMessage(M_CANCEL)); - AddChild(button); - - /* ok */ - - button = new BButton(OK_RECT, "", OK_TEXT, new BMessage(M_OK)); - AddChild(button); - button->MakeDefault(true); -} - -bool IppSetupView::UpdateViewData() -{ - string error_msg; - - if (*url->Text()) { - IppContent *request = new IppContent; - request->setOperationId(IPP_GET_PRINTER_ATTRIBUTES); - request->setDelimiter(IPP_OPERATION_ATTRIBUTES_TAG); - request->setCharset("attributes-charset", "utf-8"); - request->setNaturalLanguage("attributes-natural-language", "en-us"); - request->setURI("printer-uri", url->Text()); - request->setDelimiter(IPP_END_OF_ATTRIBUTES_TAG); - - IppURLConnection conn(URL(url->Text())); - conn.setIppRequest(request); - conn.setRequestProperty("Connection", "close"); - - HTTP_RESPONSECODE response_code = conn.getResponseCode(); - if (response_code == HTTP_OK) { - const char *content_type = conn.getContentType(); - if (content_type && !strncasecmp(content_type, "application/ipp", 15)) { - const IppContent *ipp_response = conn.getIppResponse(); - if (ipp_response->good()) { - dir->WriteAttr(IPP_URL, B_STRING_TYPE, 0, url->Text(), strlen(url->Text()) + 1); - return true; - } else { - error_msg = ipp_response->getStatusMessage(); - } - } else { - error_msg = "cannot get a IPP response."; - } - } else if (response_code != HTTP_UNKNOWN) { - error_msg = conn.getResponseMessage(); - } else { - error_msg = "cannot connect to the IPP server."; - } - } else { - error_msg = "please input the printer URL."; - } - - BAlert *alert = new BAlert("", error_msg.c_str(), "OK"); - alert->Go(); - return false; -} - -IppSetupDlg::IppSetupDlg(BDirectory *dir) - : BWindow(BRect(100, 100, 100 + DLG_WIDTH, 100 + DLG_HEIGHT), - "IPP Setup", B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, - B_NOT_RESIZABLE | B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE) -{ - result = 0; - - Lock(); - IppSetupView *view = new IppSetupView(Bounds(), dir); - AddChild(view); - Unlock(); - - semaphore = create_sem(0, "IppSetupSem"); -} - -bool IppSetupDlg::QuitRequested() -{ - result = B_ERROR; - release_sem(semaphore); - return true; -} - -void IppSetupDlg::MessageReceived(BMessage *msg) -{ - bool success; - - switch (msg->what) { - case M_OK: - Lock(); - success = ((IppSetupView *)ChildAt(0))->UpdateViewData(); - Unlock(); - if (success) { - result = B_NO_ERROR; - release_sem(semaphore); - } - break; - - case M_CANCEL: - result = B_ERROR; - release_sem(semaphore); - break; - - default: - BWindow::MessageReceived(msg); - break; - } -} - -int IppSetupDlg::Go() -{ - Show(); - acquire_sem(semaphore); - delete_sem(semaphore); - int value = result; - Lock(); - Quit(); - return value; -} +// Sun, 18 Jun 2000 +// Y.Takagi + +#include + +#include +#include +#include +#include +#include +#include + +#include "URL.h" +#include "IppContent.h" +#include "IppURLConnection.h" +#include "IppSetupDlg.h" +#include "IppDefs.h" +#include "DbgMsg.h" + +#define DLG_WIDTH 350 +#define DLG_HEIGHT 80 + +#define BUTTON_WIDTH 70 +#define BUTTON_HEIGHT 20 + +#define URL_H 10 +#define URL_V 10 +#define URL_WIDTH (DLG_WIDTH - URL_H - URL_H) +#define URL_HEIGHT 20 +#define URL_TEXT "URL" + +#define OK_H (DLG_WIDTH - BUTTON_WIDTH - 11) +#define OK_V (DLG_HEIGHT - BUTTON_HEIGHT - 11) +#define OK_TEXT "OK" + +#define CANCEL_H (OK_H - BUTTON_WIDTH - 12) +#define CANCEL_V OK_V +#define CANCEL_TEXT "Cancel" + + +const BRect URL_RECT( + URL_H, + URL_V, + URL_H + URL_WIDTH, + URL_V + URL_HEIGHT); + +const BRect OK_RECT( + OK_H, + OK_V, + OK_H + BUTTON_WIDTH, + OK_V + BUTTON_HEIGHT); + +const BRect CANCEL_RECT( + CANCEL_H, + CANCEL_V, + CANCEL_H + BUTTON_WIDTH, + CANCEL_V + BUTTON_HEIGHT); + +enum MSGS { + M_CANCEL = 1, + M_OK +}; + + +class IppSetupView : public BView { +public: + IppSetupView(BRect, BDirectory *); + ~IppSetupView() {} + virtual void AttachedToWindow(); + bool UpdateViewData(); + +private: + BTextControl *url; + BDirectory *dir; +}; + +IppSetupView::IppSetupView(BRect frame, BDirectory *d) + : BView(frame, "", B_FOLLOW_ALL, B_WILL_DRAW), dir(d) +{ + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); +} + +void IppSetupView::AttachedToWindow() +{ + /* url box */ + + url = new BTextControl(URL_RECT, "", URL_TEXT, "", NULL); + AddChild(url); + url->SetDivider(StringWidth(URL_TEXT) + 10); + + /* cancel */ + + BButton *button = new BButton(CANCEL_RECT, "", CANCEL_TEXT, new BMessage(M_CANCEL)); + AddChild(button); + + /* ok */ + + button = new BButton(OK_RECT, "", OK_TEXT, new BMessage(M_OK)); + AddChild(button); + button->MakeDefault(true); +} + +bool IppSetupView::UpdateViewData() +{ + string error_msg; + + if (*url->Text()) { + IppContent *request = new IppContent; + request->setOperationId(IPP_GET_PRINTER_ATTRIBUTES); + request->setDelimiter(IPP_OPERATION_ATTRIBUTES_TAG); + request->setCharset("attributes-charset", "utf-8"); + request->setNaturalLanguage("attributes-natural-language", "en-us"); + request->setURI("printer-uri", url->Text()); + request->setDelimiter(IPP_END_OF_ATTRIBUTES_TAG); + + IppURLConnection conn(URL(url->Text())); + conn.setIppRequest(request); + conn.setRequestProperty("Connection", "close"); + + HTTP_RESPONSECODE response_code = conn.getResponseCode(); + if (response_code == HTTP_OK) { + const char *content_type = conn.getContentType(); + if (content_type && !strncasecmp(content_type, "application/ipp", 15)) { + const IppContent *ipp_response = conn.getIppResponse(); + if (ipp_response->good()) { + dir->WriteAttr(IPP_URL, B_STRING_TYPE, 0, url->Text(), strlen(url->Text()) + 1); + return true; + } else { + error_msg = ipp_response->getStatusMessage(); + } + } else { + error_msg = "cannot get a IPP response."; + } + } else if (response_code != HTTP_UNKNOWN) { + error_msg = conn.getResponseMessage(); + } else { + error_msg = "cannot connect to the IPP server."; + } + } else { + error_msg = "please input the printer URL."; + } + + BAlert *alert = new BAlert("", error_msg.c_str(), "OK"); + alert->Go(); + return false; +} + +IppSetupDlg::IppSetupDlg(BDirectory *dir) + : BWindow(BRect(100, 100, 100 + DLG_WIDTH, 100 + DLG_HEIGHT), + "IPP Setup", B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, + B_NOT_RESIZABLE | B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE) +{ + result = 0; + + Lock(); + IppSetupView *view = new IppSetupView(Bounds(), dir); + AddChild(view); + Unlock(); + + semaphore = create_sem(0, "IppSetupSem"); +} + +bool IppSetupDlg::QuitRequested() +{ + result = B_ERROR; + release_sem(semaphore); + return true; +} + +void IppSetupDlg::MessageReceived(BMessage *msg) +{ + bool success; + + switch (msg->what) { + case M_OK: + Lock(); + success = ((IppSetupView *)ChildAt(0))->UpdateViewData(); + Unlock(); + if (success) { + result = B_NO_ERROR; + release_sem(semaphore); + } + break; + + case M_CANCEL: + result = B_ERROR; + release_sem(semaphore); + break; + + default: + BWindow::MessageReceived(msg); + break; + } +} + +int IppSetupDlg::Go() +{ + Show(); + acquire_sem(semaphore); + delete_sem(semaphore); + int value = result; + Lock(); + Quit(); + return value; +} diff --git a/src/add-ons/print/transports/ipp/IppTransport.cpp b/src/add-ons/print/transports/ipp/IppTransport.cpp index 0fcf29d329..1c4f6a967f 100644 --- a/src/add-ons/print/transports/ipp/IppTransport.cpp +++ b/src/add-ons/print/transports/ipp/IppTransport.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include "URL.h" diff --git a/src/add-ons/print/transports/ipp/URL.cpp b/src/add-ons/print/transports/ipp/URL.cpp index fe50e66458..a01c22c833 100644 --- a/src/add-ons/print/transports/ipp/URL.cpp +++ b/src/add-ons/print/transports/ipp/URL.cpp @@ -1,102 +1,103 @@ -// Sun, 18 Jun 2000 -// Y.Takagi - -#include -#include "URL.h" - -URL::URL(const char *spec) -{ -// __protocol = "http"; -// __host = "localhost"; -// __file = "/"; - __port = -1; - - if (spec) { - char *temp_spec = new char[strlen(spec) + 1]; - strcpy(temp_spec, spec); - - char *p1; - char *p2; - char *p3; - char *p4; - - p1 = strstr(temp_spec, "//"); - if (p1) { - *p1 = '\0'; - p1 += 2; - __protocol = temp_spec; - } else { - p1 = temp_spec; - } - - p3 = strstr(p1, "/"); - if (p3) { - p4 = strstr(p3, "#"); - if (p4) { - __ref = p4 + 1; - *p4 = '\0'; - } - __file = p3; - *p3 = '\0'; - } else { - __file = "/"; - } - - p2 = strstr(p1, ":"); - if (p2) { - __port = atoi(p2 + 1); - *p2 = '\0'; - } - - __host = p1; - delete [] temp_spec; - } - -// if (__port == -1) { -// if (__protocol == "http") { -// __port = 80; -// } else if (__protocol == "ipp") { -// __port = 631; -// } -// } -} - -URL::URL(const char *protocol, const char *host, int port, const char *file) -{ - __protocol = protocol; - __host = host; - __file = file; - __port = port; -} - -URL::URL(const char *protocol, const char *host, const char *file) -{ - __protocol = protocol; - __host = host; - __file = file; -} - -URL::URL(const URL &url) -{ - __protocol = url.__protocol; - __host = url.__host; - __file = url.__file; - __ref = url.__ref; - __port = url.__port; -} - -URL &URL::operator = (const URL &url) -{ - __protocol = url.__protocol; - __host = url.__host; - __file = url.__file; - __ref = url.__ref; - __port = url.__port; - return *this; -} - -bool URL::operator == (const URL &url) -{ - return (__protocol == url.__protocol) && (__host == url.__host) && (__file == url.__file) && - (__ref == url.__ref) && (__port == url.__port); -} +// Sun, 18 Jun 2000 +// Y.Takagi + +#include +#include +#include "URL.h" + +URL::URL(const char *spec) +{ +// __protocol = "http"; +// __host = "localhost"; +// __file = "/"; + __port = -1; + + if (spec) { + char *temp_spec = new char[strlen(spec) + 1]; + strcpy(temp_spec, spec); + + char *p1; + char *p2; + char *p3; + char *p4; + + p1 = strstr(temp_spec, "//"); + if (p1) { + *p1 = '\0'; + p1 += 2; + __protocol = temp_spec; + } else { + p1 = temp_spec; + } + + p3 = strstr(p1, "/"); + if (p3) { + p4 = strstr(p3, "#"); + if (p4) { + __ref = p4 + 1; + *p4 = '\0'; + } + __file = p3; + *p3 = '\0'; + } else { + __file = "/"; + } + + p2 = strstr(p1, ":"); + if (p2) { + __port = atoi(p2 + 1); + *p2 = '\0'; + } + + __host = p1; + delete [] temp_spec; + } + +// if (__port == -1) { +// if (__protocol == "http") { +// __port = 80; +// } else if (__protocol == "ipp") { +// __port = 631; +// } +// } +} + +URL::URL(const char *protocol, const char *host, int port, const char *file) +{ + __protocol = protocol; + __host = host; + __file = file; + __port = port; +} + +URL::URL(const char *protocol, const char *host, const char *file) +{ + __protocol = protocol; + __host = host; + __file = file; +} + +URL::URL(const URL &url) +{ + __protocol = url.__protocol; + __host = url.__host; + __file = url.__file; + __ref = url.__ref; + __port = url.__port; +} + +URL &URL::operator = (const URL &url) +{ + __protocol = url.__protocol; + __host = url.__host; + __file = url.__file; + __ref = url.__ref; + __port = url.__port; + return *this; +} + +bool URL::operator == (const URL &url) +{ + return (__protocol == url.__protocol) && (__host == url.__host) && (__file == url.__file) && + (__ref == url.__ref) && (__port == url.__port); +} diff --git a/src/add-ons/print/transports/lpr/LprSetupDlg.cpp b/src/add-ons/print/transports/lpr/LprSetupDlg.cpp index 29ba3d4fdd..04f8f29ff8 100644 --- a/src/add-ons/print/transports/lpr/LprSetupDlg.cpp +++ b/src/add-ons/print/transports/lpr/LprSetupDlg.cpp @@ -9,6 +9,7 @@ #include #include +#include #include "LpsClient.h" #include "LprSetupDlg.h" diff --git a/src/add-ons/print/transports/lpr/LprTransport.cpp b/src/add-ons/print/transports/lpr/LprTransport.cpp index 97f91f83c4..609920caae 100644 --- a/src/add-ons/print/transports/lpr/LprTransport.cpp +++ b/src/add-ons/print/transports/lpr/LprTransport.cpp @@ -9,9 +9,10 @@ #include #include #include +#include #include #include -#include +#include #include "LpsClient.h" #include "LprSetupDlg.h" diff --git a/src/add-ons/print/transports/lpr/LpsClient.cpp b/src/add-ons/print/transports/lpr/LpsClient.cpp index 514488718b..bb5cb96a39 100644 --- a/src/add-ons/print/transports/lpr/LpsClient.cpp +++ b/src/add-ons/print/transports/lpr/LpsClient.cpp @@ -8,7 +8,9 @@ # include # include #endif + #include +#include #include #include diff --git a/src/add-ons/print/transports/shared/Socket.cpp b/src/add-ons/print/transports/shared/Socket.cpp index 3d0f4fbeeb..f3ef272380 100644 --- a/src/add-ons/print/transports/shared/Socket.cpp +++ b/src/add-ons/print/transports/shared/Socket.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include "Socket.h" diff --git a/src/add-ons/translators/bmp/BMPTranslator.cpp b/src/add-ons/translators/bmp/BMPTranslator.cpp index 9b03ae036e..a78f021b8a 100644 --- a/src/add-ons/translators/bmp/BMPTranslator.cpp +++ b/src/add-ons/translators/bmp/BMPTranslator.cpp @@ -9,6 +9,7 @@ #include "BMPTranslator.h" #include "BMPView.h" +#include #include #include #include @@ -16,6 +17,7 @@ using std::nothrow; +using std::min; //#define INFO(x) printf(x); #define INFO(x) @@ -1706,12 +1708,12 @@ BMPTranslator::translate_from_bmp(BPositionIO *inSource, uint32 outType, if (!frommsformat && os2skip) inSource->Seek(os2skip, SEEK_CUR); - rd = min(1024, fileHeader.fileSize - rdtotal); + rd = min((size_t)1024, fileHeader.fileSize - rdtotal); rd = inSource->Read(buf, rd); while (rd > 0) { outDestination->Write(buf, rd); rdtotal += rd; - rd = min(1024, fileHeader.fileSize - rdtotal); + rd = min((size_t)1024, fileHeader.fileSize - rdtotal); rd = inSource->Read(buf, rd); } if (rd == 0) diff --git a/src/add-ons/translators/stxt/STXTTranslator.cpp b/src/add-ons/translators/stxt/STXTTranslator.cpp index a3dd9693b7..299d6ac3b8 100644 --- a/src/add-ons/translators/stxt/STXTTranslator.cpp +++ b/src/add-ons/translators/stxt/STXTTranslator.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -24,6 +25,7 @@ using namespace BPrivate; +using namespace std; #define READ_BUFFER_SIZE 32768 @@ -970,7 +972,7 @@ translate_from_stxt(BPositionIO *inSource, BPositionIO *outDestination, // When outputting B_STYLED_TEXT_FORMAT, the loop stops when all // of the data from inSource has been read and written. if (btoplain) - nreed = min(READ_BUFFER_SIZE, + nreed = min((size_t)READ_BUFFER_SIZE, txtheader.header.data_size - ntotalread); else nreed = READ_BUFFER_SIZE; @@ -982,7 +984,7 @@ translate_from_stxt(BPositionIO *inSource, BPositionIO *outDestination, if (btoplain) { ntotalread += nread; - nreed = min(READ_BUFFER_SIZE, + nreed = min((size_t)READ_BUFFER_SIZE, txtheader.header.data_size - ntotalread); } else nreed = READ_BUFFER_SIZE; diff --git a/src/apps/codycam/FtpClient.cpp b/src/apps/codycam/FtpClient.cpp index e181d5c7e7..e29d29eecf 100644 --- a/src/apps/codycam/FtpClient.cpp +++ b/src/apps/codycam/FtpClient.cpp @@ -1,5 +1,8 @@ #include "FtpClient.h" +#include +#include + FtpClient::FtpClient() : FileUploadClient(), fState(0), diff --git a/src/apps/cortex/Persistence/ExportContext.h b/src/apps/cortex/Persistence/ExportContext.h index 98dc6a6b19..f99d773e32 100644 --- a/src/apps/cortex/Persistence/ExportContext.h +++ b/src/apps/cortex/Persistence/ExportContext.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include diff --git a/src/apps/cortex/Persistence/IPersistent.h b/src/apps/cortex/Persistence/IPersistent.h index 74e75f37f7..995760de82 100644 --- a/src/apps/cortex/Persistence/IPersistent.h +++ b/src/apps/cortex/Persistence/IPersistent.h @@ -22,7 +22,7 @@ #include "ImportContext.h" #include "ExportContext.h" -#include +#include #include "cortex_defs.h" __BEGIN_CORTEX_NAMESPACE diff --git a/src/apps/diskusage/InfoWindow.cpp b/src/apps/diskusage/InfoWindow.cpp index d1e1d6bec5..716d3be39a 100644 --- a/src/apps/diskusage/InfoWindow.cpp +++ b/src/apps/diskusage/InfoWindow.cpp @@ -8,9 +8,10 @@ */ #include "InfoWindow.h" -#include #include +#include #include +#include #include #include @@ -22,6 +23,7 @@ using std::string; using std::vector; +using std::pair; LeftView::LeftView(BRect frame, BBitmap* icon) : BView(frame, NULL, B_FOLLOW_NONE, B_WILL_DRAW), diff --git a/src/apps/diskusage/Scanner.cpp b/src/apps/diskusage/Scanner.cpp index 170e39ed0e..f9d1db3ccb 100644 --- a/src/apps/diskusage/Scanner.cpp +++ b/src/apps/diskusage/Scanner.cpp @@ -8,6 +8,9 @@ */ #include "Scanner.h" +#include +#include + #include #include "Common.h" diff --git a/src/apps/diskusage/Snapshot.cpp b/src/apps/diskusage/Snapshot.cpp index b9100bc62d..0d27b41c37 100644 --- a/src/apps/diskusage/Snapshot.cpp +++ b/src/apps/diskusage/Snapshot.cpp @@ -9,6 +9,7 @@ #include "Snapshot.h" #include +#include #include #include diff --git a/src/apps/icon-o-matic/generic/command/CommandStack.h b/src/apps/icon-o-matic/generic/command/CommandStack.h index 0c33a0e377..062da536f5 100644 --- a/src/apps/icon-o-matic/generic/command/CommandStack.h +++ b/src/apps/icon-o-matic/generic/command/CommandStack.h @@ -9,7 +9,7 @@ #ifndef COMMAND_STACK_H #define COMMAND_STACK_H -#include +#include #include @@ -39,7 +39,7 @@ class CommandStack : public BLocker, private: status_t _AddCommand(Command* command); - typedef stack command_stack; + typedef std::stack command_stack; command_stack fUndoHistory; command_stack fRedoHistory; diff --git a/src/apps/icon-o-matic/generic/gui/scrollview/ScrollView.cpp b/src/apps/icon-o-matic/generic/gui/scrollview/ScrollView.cpp index 70d1130a19..fc60d472f3 100644 --- a/src/apps/icon-o-matic/generic/gui/scrollview/ScrollView.cpp +++ b/src/apps/icon-o-matic/generic/gui/scrollview/ScrollView.cpp @@ -9,7 +9,7 @@ #include "ScrollView.h" -#include +#include #include #include @@ -24,6 +24,7 @@ #include "Scrollable.h" #include "ScrollCornerBitmaps.h" +using namespace std; // #pragma mark - InternalScrollBar diff --git a/src/apps/icon-o-matic/generic/gui/scrollview/Scrollable.cpp b/src/apps/icon-o-matic/generic/gui/scrollview/Scrollable.cpp index 82fbb17b5c..07913a4775 100644 --- a/src/apps/icon-o-matic/generic/gui/scrollview/Scrollable.cpp +++ b/src/apps/icon-o-matic/generic/gui/scrollview/Scrollable.cpp @@ -8,11 +8,13 @@ #include "Scrollable.h" -#include +#include #include #include "Scroller.h" +using namespace std; + // constructor Scrollable::Scrollable() : fDataRect(0.0, 0.0, 0.0, 0.0), diff --git a/src/apps/icon-o-matic/generic/gui/stateview/StateView.cpp b/src/apps/icon-o-matic/generic/gui/stateview/StateView.cpp index 09d185a933..aa2825651f 100644 --- a/src/apps/icon-o-matic/generic/gui/stateview/StateView.cpp +++ b/src/apps/icon-o-matic/generic/gui/stateview/StateView.cpp @@ -8,6 +8,8 @@ #include "StateView.h" +#include + #include #include #include diff --git a/src/apps/icon-o-matic/gui/PathListView.cpp b/src/apps/icon-o-matic/gui/PathListView.cpp index eb3b7fcb55..639aaf0230 100644 --- a/src/apps/icon-o-matic/gui/PathListView.cpp +++ b/src/apps/icon-o-matic/gui/PathListView.cpp @@ -8,6 +8,7 @@ #include "PathListView.h" +#include #include #include diff --git a/src/apps/icon-o-matic/gui/StyleListView.cpp b/src/apps/icon-o-matic/gui/StyleListView.cpp index fce48e1f3e..bbf9d87c3f 100644 --- a/src/apps/icon-o-matic/gui/StyleListView.cpp +++ b/src/apps/icon-o-matic/gui/StyleListView.cpp @@ -8,6 +8,7 @@ #include "StyleListView.h" +#include #include #include diff --git a/src/apps/icon-o-matic/gui/StyleView.cpp b/src/apps/icon-o-matic/gui/StyleView.cpp index fab4a938ac..9a8ac389d0 100644 --- a/src/apps/icon-o-matic/gui/StyleView.cpp +++ b/src/apps/icon-o-matic/gui/StyleView.cpp @@ -8,6 +8,8 @@ #include "StyleView.h" +#include + #if __HAIKU__ # include "GridLayout.h" # include "GroupLayout.h" diff --git a/src/apps/icon-o-matic/import_export/Exporter.cpp b/src/apps/icon-o-matic/import_export/Exporter.cpp index b034642427..a31ebee109 100644 --- a/src/apps/icon-o-matic/import_export/Exporter.cpp +++ b/src/apps/icon-o-matic/import_export/Exporter.cpp @@ -9,6 +9,7 @@ #include "Exporter.h" #include +#include #include #include diff --git a/src/apps/icon-o-matic/import_export/flat_icon/RDefExporter.cpp b/src/apps/icon-o-matic/import_export/flat_icon/RDefExporter.cpp index 95c94f0135..c1db24bf80 100644 --- a/src/apps/icon-o-matic/import_export/flat_icon/RDefExporter.cpp +++ b/src/apps/icon-o-matic/import_export/flat_icon/RDefExporter.cpp @@ -9,6 +9,7 @@ #include "RDefExporter.h" #include +#include #include diff --git a/src/apps/icon-o-matic/import_export/flat_icon/SourceExporter.cpp b/src/apps/icon-o-matic/import_export/flat_icon/SourceExporter.cpp index 930bcd4cc0..5541c87b75 100644 --- a/src/apps/icon-o-matic/import_export/flat_icon/SourceExporter.cpp +++ b/src/apps/icon-o-matic/import_export/flat_icon/SourceExporter.cpp @@ -9,6 +9,7 @@ #include "SourceExporter.h" #include +#include #include diff --git a/src/apps/mediaplayer/interface/TransportButton.cpp b/src/apps/mediaplayer/interface/TransportButton.cpp index 44ef61b530..e0338ae3fb 100644 --- a/src/apps/mediaplayer/interface/TransportButton.cpp +++ b/src/apps/mediaplayer/interface/TransportButton.cpp @@ -19,6 +19,7 @@ #include #include +#include #include "TransportButton.h" #include "DrawingTidbits.h" diff --git a/src/apps/mediaplayer/media_node_framework/PlaybackManager.cpp b/src/apps/mediaplayer/media_node_framework/PlaybackManager.cpp index e085453302..a3ba605965 100644 --- a/src/apps/mediaplayer/media_node_framework/PlaybackManager.cpp +++ b/src/apps/mediaplayer/media_node_framework/PlaybackManager.cpp @@ -1,6 +1,6 @@ // PlaybackManager.cpp -#include +#include #include #include @@ -13,6 +13,8 @@ #include "PlaybackManager.h" +using namespace std; + //#define TRACE_NODE_MANAGER #ifdef TRACE_NODE_MANAGER # define TRACE(x...) printf(x) diff --git a/src/apps/mediaplayer/media_node_framework/audio/AudioAdapter.cpp b/src/apps/mediaplayer/media_node_framework/audio/AudioAdapter.cpp index 61fd78addc..fd9476ecfb 100644 --- a/src/apps/mediaplayer/media_node_framework/audio/AudioAdapter.cpp +++ b/src/apps/mediaplayer/media_node_framework/audio/AudioAdapter.cpp @@ -5,7 +5,6 @@ #include "AudioAdapter.h" #include -#include #include #include diff --git a/src/apps/mediaplayer/media_node_framework/audio/AudioChannelConverter.cpp b/src/apps/mediaplayer/media_node_framework/audio/AudioChannelConverter.cpp index 0ece63227e..a33215b14d 100644 --- a/src/apps/mediaplayer/media_node_framework/audio/AudioChannelConverter.cpp +++ b/src/apps/mediaplayer/media_node_framework/audio/AudioChannelConverter.cpp @@ -5,7 +5,6 @@ #include "AudioChannelConverter.h" #include -#include #include #include diff --git a/src/apps/mediaplayer/media_node_framework/audio/AudioFormatConverter.cpp b/src/apps/mediaplayer/media_node_framework/audio/AudioFormatConverter.cpp index d959c4805e..e8895bcfbd 100644 --- a/src/apps/mediaplayer/media_node_framework/audio/AudioFormatConverter.cpp +++ b/src/apps/mediaplayer/media_node_framework/audio/AudioFormatConverter.cpp @@ -6,8 +6,6 @@ #include "AudioFormatConverter.h" -#include - #include #include diff --git a/src/apps/mediaplayer/media_node_framework/audio/AudioReader.cpp b/src/apps/mediaplayer/media_node_framework/audio/AudioReader.cpp index a0e3b9089c..e770b13764 100644 --- a/src/apps/mediaplayer/media_node_framework/audio/AudioReader.cpp +++ b/src/apps/mediaplayer/media_node_framework/audio/AudioReader.cpp @@ -2,11 +2,13 @@ * Copyright © 2000-2006 Ingo Weinhold * All rights reserved. Distributed under the terms of the MIT licensce. */ -#include +#include #include #include "AudioReader.h" +using std::swap; + AudioReader::AudioReader() : fFormat(), diff --git a/src/apps/mediaplayer/media_node_framework/audio/AudioResampler.cpp b/src/apps/mediaplayer/media_node_framework/audio/AudioResampler.cpp index b9025181f0..8afea05f37 100644 --- a/src/apps/mediaplayer/media_node_framework/audio/AudioResampler.cpp +++ b/src/apps/mediaplayer/media_node_framework/audio/AudioResampler.cpp @@ -4,7 +4,6 @@ */ #include "AudioResampler.h" -#include #include #include "SampleBuffer.h" diff --git a/src/apps/mediaplayer/playlist/Playlist.cpp b/src/apps/mediaplayer/playlist/Playlist.cpp index 2b8f2bb2c2..c793cc90fa 100644 --- a/src/apps/mediaplayer/playlist/Playlist.cpp +++ b/src/apps/mediaplayer/playlist/Playlist.cpp @@ -22,7 +22,7 @@ #include "Playlist.h" #include -#include +#include #include #include diff --git a/src/apps/mediaplayer/supplier/MediaTrackAudioSupplier.cpp b/src/apps/mediaplayer/supplier/MediaTrackAudioSupplier.cpp index 200f0a231a..f57048647d 100644 --- a/src/apps/mediaplayer/supplier/MediaTrackAudioSupplier.cpp +++ b/src/apps/mediaplayer/supplier/MediaTrackAudioSupplier.cpp @@ -6,15 +6,14 @@ #include "MediaTrackAudioSupplier.h" #include -#include +#include #include #include #include #include -using std::nothrow; - +using namespace std; //#define TRACE_AUDIO_SUPPLIER #ifdef TRACE_AUDIO_SUPPLIER diff --git a/src/apps/mediaplayer/supplier/ProxyAudioSupplier.cpp b/src/apps/mediaplayer/supplier/ProxyAudioSupplier.cpp index 5349bfadd8..181deb5e46 100644 --- a/src/apps/mediaplayer/supplier/ProxyAudioSupplier.cpp +++ b/src/apps/mediaplayer/supplier/ProxyAudioSupplier.cpp @@ -4,7 +4,7 @@ */ #include "ProxyAudioSupplier.h" -#include +#include #include #include #include @@ -18,6 +18,7 @@ #include "PlaybackManager.h" using std::nothrow; +using std::swap; //#define TRACE_PROXY_AUDIO_SUPPLIER diff --git a/src/apps/mediaplayer/support/CommandStack.h b/src/apps/mediaplayer/support/CommandStack.h index 0e479eebb0..3e8414d3db 100644 --- a/src/apps/mediaplayer/support/CommandStack.h +++ b/src/apps/mediaplayer/support/CommandStack.h @@ -8,7 +8,7 @@ #ifndef COMMAND_STACK_H #define COMMAND_STACK_H -#include +#include #include "Notifier.h" @@ -38,7 +38,7 @@ class CommandStack : public Notifier { RWLocker* fLocker; - typedef stack command_stack; + typedef std::stack command_stack; command_stack fUndoHistory; command_stack fRedoHistory; diff --git a/src/apps/sudoku/Stack.h b/src/apps/sudoku/Stack.h index dc832aabf1..02ec2c343e 100644 --- a/src/apps/sudoku/Stack.h +++ b/src/apps/sudoku/Stack.h @@ -9,6 +9,7 @@ #include +#include template class Stack { public: diff --git a/src/apps/sudoku/SudokuGenerator.cpp b/src/apps/sudoku/SudokuGenerator.cpp index 6ca45aa96b..cce863a8f9 100644 --- a/src/apps/sudoku/SudokuGenerator.cpp +++ b/src/apps/sudoku/SudokuGenerator.cpp @@ -11,6 +11,8 @@ #include "SudokuSolver.h" #include +#include +#include SudokuGenerator::SudokuGenerator() { diff --git a/src/apps/sudoku/SudokuWindow.cpp b/src/apps/sudoku/SudokuWindow.cpp index f8583e7626..001c05436d 100644 --- a/src/apps/sudoku/SudokuWindow.cpp +++ b/src/apps/sudoku/SudokuWindow.cpp @@ -46,7 +46,7 @@ const uint32 kMsgExportAs = 'expt'; class GenerateSudoku { public: - GenerateSudoku(SudokuField& target, int32 level, BMessenger progress, + GenerateSudoku(SudokuField& field, int32 level, BMessenger progress, BMessenger target); ~GenerateSudoku(); diff --git a/src/bin/debug/debug_utils.cpp b/src/bin/debug/debug_utils.cpp index 52a9e19c45..8ce6ec0cfa 100644 --- a/src/bin/debug/debug_utils.cpp +++ b/src/bin/debug/debug_utils.cpp @@ -10,6 +10,7 @@ #include #include +#include #include diff --git a/src/bin/debug/strace/TypeHandler.cpp b/src/bin/debug/strace/TypeHandler.cpp index 88dfa8ea05..4275f81941 100644 --- a/src/bin/debug/strace/TypeHandler.cpp +++ b/src/bin/debug/strace/TypeHandler.cpp @@ -9,6 +9,8 @@ #include "TypeHandler.h" +#include + #include "Context.h" #include "MemoryReader.h" #include "Syscall.h" diff --git a/src/kits/storage/AddOnMonitorHandler.cpp b/src/kits/storage/AddOnMonitorHandler.cpp index dbadbfb76a..e026789b26 100644 --- a/src/kits/storage/AddOnMonitorHandler.cpp +++ b/src/kits/storage/AddOnMonitorHandler.cpp @@ -8,6 +8,8 @@ #include "AddOnMonitorHandler.h" +#include + #include diff --git a/src/libs/print/libprint/Halftone.cpp b/src/libs/print/libprint/Halftone.cpp index 160c6055c7..903a7fa53d 100644 --- a/src/libs/print/libprint/Halftone.cpp +++ b/src/libs/print/libprint/Halftone.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "Halftone.h" #include "ValidRect.h" #include "DbgMsg.h" diff --git a/src/servers/app/drawing/DrawingEngine.cpp b/src/servers/app/drawing/DrawingEngine.cpp index d6bd82e759..d2d58fd9ab 100644 --- a/src/servers/app/drawing/DrawingEngine.cpp +++ b/src/servers/app/drawing/DrawingEngine.cpp @@ -10,8 +10,8 @@ #include #include -#include -#include +#include +#include #include "DrawState.h" #include "GlyphLayoutEngine.h" @@ -489,7 +489,7 @@ DrawingEngine::CopyRegion(/*const*/ BRegion* region, } } // put all nodes onto a stack that have an "indegree" count of zero - stack inDegreeZeroNodes; + std::stack inDegreeZeroNodes; for (int32 i = 0; i < count; i++) { if (nodes[i].in_degree == 0) { inDegreeZeroNodes.push(&nodes[i]); diff --git a/src/servers/net/Services.cpp b/src/servers/net/Services.cpp index e40972ecec..4e5df8f3d3 100644 --- a/src/servers/net/Services.cpp +++ b/src/servers/net/Services.cpp @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/src/servers/registrar/MessageDeliverer.cpp b/src/servers/registrar/MessageDeliverer.cpp index 0819071b69..c1929bed6b 100644 --- a/src/servers/registrar/MessageDeliverer.cpp +++ b/src/servers/registrar/MessageDeliverer.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include diff --git a/src/servers/registrar/RecentApps.cpp b/src/servers/registrar/RecentApps.cpp index c149085f3f..f835d751f5 100644 --- a/src/servers/registrar/RecentApps.cpp +++ b/src/servers/registrar/RecentApps.cpp @@ -22,6 +22,8 @@ #include #include +#include + #define DBG(x) (x) //#define DBG(x) #define OUT printf diff --git a/src/servers/registrar/ShutdownProcess.cpp b/src/servers/registrar/ShutdownProcess.cpp index 73ef9b3141..0758b77a4d 100644 --- a/src/servers/registrar/ShutdownProcess.cpp +++ b/src/servers/registrar/ShutdownProcess.cpp @@ -4,6 +4,7 @@ */ #include +#include #include #include diff --git a/src/servers/registrar/TRoster.cpp b/src/servers/registrar/TRoster.cpp index 2c3c2733df..7ad49f15d2 100644 --- a/src/servers/registrar/TRoster.cpp +++ b/src/servers/registrar/TRoster.cpp @@ -24,6 +24,7 @@ #include #include +#include #include "AppInfoListMessagingTargetSet.h" #include "Debug.h" diff --git a/src/servers/registrar/mime/CreateAppMetaMimeThread.cpp b/src/servers/registrar/mime/CreateAppMetaMimeThread.cpp index b53007c338..c4f8484897 100644 --- a/src/servers/registrar/mime/CreateAppMetaMimeThread.cpp +++ b/src/servers/registrar/mime/CreateAppMetaMimeThread.cpp @@ -11,6 +11,7 @@ #include "CreateAppMetaMimeThread.h" #include +#include #include #include diff --git a/src/servers/registrar/mime/UpdateMimeInfoThread.cpp b/src/servers/registrar/mime/UpdateMimeInfoThread.cpp index d971070ba5..f3c3bd463c 100644 --- a/src/servers/registrar/mime/UpdateMimeInfoThread.cpp +++ b/src/servers/registrar/mime/UpdateMimeInfoThread.cpp @@ -9,6 +9,9 @@ #include "UpdateMimeInfoThread.h" +#include +#include + #include #include #include