[haiku-commits] haiku: hrev49458 - src/bin src/add-ons/mail_daemon/outbound_protocols/smtp headers/libs/agg src/servers/app/drawing/interface/remote src/apps/remotedesktop

  • From: jerome.duval@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 26 Jul 2015 00:32:34 +0200 (CEST)

hrev49458 adds 5 changesets to branch 'master'
old head: 5dab45be766adf3716d356b8c7fa5858548f6d90
new head: 4fb4b32043174432f9b12b56f2e20a652ff2091c
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=4fb4b3204317+%5E5dab45be766a

----------------------------------------------------------------------------

b2a0b6323e67: screenshot: fixed parenthesis warning on not operator...

* "logical not is only applied to the left hand side of comparison"
* found with GCC6

d0017f376642: libtracker.so: fixed parenthesis warning on not operator...

* "logical not is only applied to the left hand side of comparison"
* found with GCC6

66fdfe327035: setmime: hash() conflicts with std::hash.

* found with GCC6

9cd62a24e568: Fixed C++11 warnings.

invalid suffix on literal; C++11 requires a space between literal and string
macro
[-Werror=literal-suffix]

4fb4b3204317: Force use of std::isnan() in agg_conv_curve.h.

cmath could be included before inclusion of this header, thus undefining
isnan.

[ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

10 files changed, 54 insertions(+), 50 deletions(-)
headers/libs/agg/agg_conv_curve.h | 11 +++--
.../mail_daemon/outbound_protocols/smtp/SMTP.cpp | 20 ++++-----
src/apps/remotedesktop/RemoteView.cpp | 6 +--
src/apps/screenshot/Screenshot.cpp | 2 +-
src/apps/tv/config.h | 6 +--
src/bin/setmime.cpp | 44 ++++++++++----------
src/kits/tracker/SettingsViews.cpp | 4 +-
src/preferences/notifications/GeneralView.cpp | 3 +-
.../app/drawing/interface/remote/NetReceiver.cpp | 4 +-
.../app/drawing/interface/remote/NetSender.cpp | 4 +-

############################################################################

Commit: b2a0b6323e67b7285efd1767a0e0a439853e8bf5
URL: http://cgit.haiku-os.org/haiku/commit/?id=b2a0b6323e67
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Sat Jul 25 14:22:07 2015 UTC

screenshot: fixed parenthesis warning on not operator...

* "logical not is only applied to the left hand side of comparison"
* found with GCC6

----------------------------------------------------------------------------

diff --git a/src/apps/screenshot/Screenshot.cpp
b/src/apps/screenshot/Screenshot.cpp
index 88bac5d..ef17978 100644
--- a/src/apps/screenshot/Screenshot.cpp
+++ b/src/apps/screenshot/Screenshot.cpp
@@ -308,7 +308,7 @@ Screenshot::_GetActiveWindowFrame()
token = tokens[i];
windowInfo = get_window_info(token);
if (windowInfo && !windowInfo->is_mini
- && !windowInfo->show_hide_level

0) {
+ &&
!(windowInfo->show_hide_level > 0)) {
foundActiveWindow = true;
break;
}

############################################################################

Commit: d0017f376642742c180e2c3b6da1a155903acc51
URL: http://cgit.haiku-os.org/haiku/commit/?id=d0017f376642
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Sat Jul 25 14:26:29 2015 UTC

libtracker.so: fixed parenthesis warning on not operator...

* "logical not is only applied to the left hand side of comparison"
* found with GCC6

----------------------------------------------------------------------------

diff --git a/src/kits/tracker/SettingsViews.cpp
b/src/kits/tracker/SettingsViews.cpp
index 4b80b8c..18be422 100644
--- a/src/kits/tracker/SettingsViews.cpp
+++ b/src/kits/tracker/SettingsViews.cpp
@@ -234,7 +234,7 @@ DesktopSettingsView::MessageReceived(BMessage* message)
{
// Turn on and off related settings:
fMountVolumesOntoDesktopRadioButton->SetValue(
- !fShowDisksIconRadioButton->Value() == 1);
+ !(fShowDisksIconRadioButton->Value() == 1));
fMountSharedVolumesOntoDesktopCheckBox->SetEnabled(
fMountVolumesOntoDesktopRadioButton->Value() ==
1);

@@ -267,7 +267,7 @@ DesktopSettingsView::MessageReceived(BMessage* message)
{
// Turn on and off related settings:
fShowDisksIconRadioButton->SetValue(
- !fMountVolumesOntoDesktopRadioButton->Value()
== 1);
+ !(fMountVolumesOntoDesktopRadioButton->Value()
== 1));
fMountSharedVolumesOntoDesktopCheckBox->SetEnabled(
fMountVolumesOntoDesktopRadioButton->Value() ==
1);


############################################################################

Commit: 66fdfe327035ca1df9eb10926aa084392e648eb7
URL: http://cgit.haiku-os.org/haiku/commit/?id=66fdfe327035
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Sat Jul 25 14:28:44 2015 UTC

setmime: hash() conflicts with std::hash.

* found with GCC6

----------------------------------------------------------------------------

diff --git a/src/bin/setmime.cpp b/src/bin/setmime.cpp
index 37029e2..8078c60 100644
--- a/src/bin/setmime.cpp
+++ b/src/bin/setmime.cpp
@@ -103,7 +103,7 @@ const char* kAttrEditable = "-attrEditable";
const char* kAttrExtra = "-attrExtra";


-const uint32 hash(const char* str)
+const uint32 hash_function(const char* str)
{
uint32 h = 0;
uint32 g = 0;
@@ -466,7 +466,7 @@ MimeAttribute::StoreInto(BMessage* target)
const char*
MimeAttribute::UserArgValue(TUserArgs& map, const char* name)
{
- TUserArgsI i = map.find(hash(name));
+ TUserArgsI i = map.find(hash_function(name));
if (i == map.end())
return NULL;
return i->second != NULL ? i->second : "";
@@ -574,7 +574,7 @@ MimeType::_Init(char** argv) throw (Error)
map<uint32, const CmdOption*> cmdOptionsMap;
for (size_t i = 0; i < sizeof(gCmdOptions) / sizeof(gCmdOptions[0]);
i++)
cmdOptionsMap.insert(pair<uint32, CmdOption*>(
-
hash(gCmdOptions[i].fName), &gCmdOptions[i]));
+
hash_function(gCmdOptions[i].fName), &gCmdOptions[i]));

// parse the command line arguments
for (char** arg = argv; *arg; arg++) {
@@ -588,7 +588,7 @@ MimeType::_Init(char** argv) throw (Error)
}

// check op.modes, options and attribs
- uint32 key = hash(*arg);
+ uint32 key = hash_function(*arg);

map<uint32, const CmdOption*>::iterator I =
cmdOptionsMap.find(key);
if (I == cmdOptionsMap.end())
@@ -605,7 +605,7 @@ MimeType::_Init(char** argv) throw (Error)
throw Error(kWrongModeMessage);
fOpMode = key;

- if (hash(I->second->fName) !=
hash(kCheckSniffRule))
+ if (hash_function(I->second->fName) !=
hash_function(kCheckSniffRule))
break;
// else -> fallthrough, CheckRule works both as
mode and Option
case CmdOption::kOption:
@@ -669,15 +669,15 @@ MimeType::_Init(char** argv) throw (Error)
throw Error("error instantiating mime for '%s': %s",
Type(),
strerror(InitCheck()));

- fDoAdd = fOpMode == hash(kAdd);
- fDoSet = fOpMode == hash(kSet);
- fDoForce = fOpMode == hash(kForce);
- fDoRemove = fOpMode == hash(kRemove);
- fDumpNormal = fOpMode == hash(kDump);
- fDumpRule = fOpMode == hash(kDumpSniffRule);
- fDumpIcon = fOpMode == hash(kDumpIcon);
- fDumpAll = fOpMode == hash(kDumpAll);
- fCheckSniffRule = fOpMode == hash(kCheckSniffRule);
+ fDoAdd = fOpMode == hash_function(kAdd);
+ fDoSet = fOpMode == hash_function(kSet);
+ fDoForce = fOpMode == hash_function(kForce);
+ fDoRemove = fOpMode == hash_function(kRemove);
+ fDumpNormal = fOpMode == hash_function(kDump);
+ fDumpRule = fOpMode == hash_function(kDumpSniffRule);
+ fDumpIcon = fOpMode == hash_function(kDumpIcon);
+ fDumpAll = fOpMode == hash_function(kDumpAll);
+ fCheckSniffRule = fOpMode == hash_function(kCheckSniffRule);

if (fDoAdd || fDoSet || fDoForce || fDoRemove) {
if (Type() == NULL)
@@ -835,7 +835,7 @@ MimeType::_SetTo(const char* mimetype) throw (Error)
uint32 i = 0;
const char* ext = NULL;
while (exts.FindString("extensions", i++, &ext) == B_OK)
- fExtensions.insert(pair<uint32, BString>(hash(ext),
ext));
+ fExtensions.insert(pair<uint32,
BString>(hash_function(ext), ext));
}

BMessage attrs;
@@ -847,7 +847,7 @@ MimeType::_SetTo(const char* mimetype) throw (Error)
break;

fAttributes.insert(
- pair<uint32,
MimeAttribute>(hash(attr.fName), attr));
+ pair<uint32,
MimeAttribute>(hash_function(attr.fName), attr));
}
}

@@ -871,7 +871,7 @@ MimeType::_SetTo(const char* mimetype) throw (Error)
const char*
MimeType::_UserArgValue(const char* name)
{
- TUserArgsI i = fUserArguments.find(hash(name));
+ TUserArgsI i = fUserArguments.find(hash_function(name));
if (i == fUserArguments.end())
return NULL;

@@ -1030,9 +1030,9 @@ MimeType::_DoEdit() throw (Error)

// handle extensions update
pair<TUserArgsI, TUserArgsI> exts
- =
fUserArguments.equal_range(hash(kExtension));
+ =
fUserArguments.equal_range(hash_function(kExtension));
for (TUserArgsI i = exts.first; i != exts.second; i++) {
- uint32 key = hash(i->second);
+ uint32 key = hash_function(i->second);
if (fExtensions.find(key) == fExtensions.end())
fExtensions.insert(pair<uint32, BString>(key,
i->second));
}
@@ -1054,18 +1054,18 @@ MimeType::_DoEdit() throw (Error)
userAttr != fUserAttributes.end(); userAttr++ )
{
// search for -attribute "name" in args map
- TUserArgsI attrArgs = userAttr->find(hash(kAttribute));
+ TUserArgsI attrArgs = userAttr->find(hash_function(kAttribute));
if (attrArgs == userAttr->end())
throw Error("internal error: %s arg not found",
kAttribute);

// check if we already have this attribute cached
map<uint32, MimeAttribute>::iterator
- attr =
fAttributes.find(hash(attrArgs->second));
+ attr =
fAttributes.find(hash_function(attrArgs->second));
if (attr == fAttributes.end()) {
// add new one
MimeAttribute mimeAttr(*userAttr);
fAttributes.insert(
- pair<uint32,
MimeAttribute>(hash(mimeAttr.fName), mimeAttr));
+ pair<uint32,
MimeAttribute>(hash_function(mimeAttr.fName), mimeAttr));
} else if (!fDoAdd)
attr->second.SyncWith(*userAttr);
}

############################################################################

Commit: 9cd62a24e5680e70edbeb81069e0e01b1fb4874f
URL: http://cgit.haiku-os.org/haiku/commit/?id=9cd62a24e568
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Sat Jul 25 15:06:53 2015 UTC

Fixed C++11 warnings.

invalid suffix on literal; C++11 requires a space between literal and string
macro
[-Werror=literal-suffix]

----------------------------------------------------------------------------

diff --git a/src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp
b/src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp
index f156104..59ad170 100644
--- a/src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp
+++ b/src/add-ons/mail_daemon/outbound_protocols/smtp/SMTP.cpp
@@ -450,9 +450,9 @@ SMTPProtocol::Open(const char *address, int port, bool
esmtp)

char *cmd = new char[::strlen(localhost)+8];
if (!esmtp)
- ::sprintf(cmd,"HELO %s"CRLF, localhost);
+ ::sprintf(cmd,"HELO %s" CRLF, localhost);
else
- ::sprintf(cmd,"EHLO %s"CRLF, localhost);
+ ::sprintf(cmd,"EHLO %s" CRLF, localhost);

if (SendCommand(cmd) != B_OK) {
delete[] cmd;
@@ -467,7 +467,7 @@ SMTPProtocol::Open(const char *address, int port, bool
esmtp)

SSL_library_init();
RAND_seed(this,sizeof(SMTPProtocol));
- ::sprintf(cmd, "STARTTLS"CRLF);
+ ::sprintf(cmd, "STARTTLS" CRLF);

if ((p = ::strstr(res, "STARTTLS")) != NULL) {
// Server advertises STARTTLS support
@@ -489,9 +489,9 @@ SMTPProtocol::Open(const char *address, int port, bool
esmtp)

// Should send EHLO command again
if(!esmtp)
- ::sprintf(cmd, "HELO %s"CRLF, localhost);
+ ::sprintf(cmd, "HELO %s" CRLF, localhost);
else
- ::sprintf(cmd, "EHLO %s"CRLF, localhost);
+ ::sprintf(cmd, "EHLO %s" CRLF, localhost);

if (SendCommand(cmd) != B_OK) {
delete[] cmd;
@@ -604,7 +604,7 @@ SMTPProtocol::Login(const char *_login, const char
*password)
// required for authentication to SMTP-servers. Integrity-
// and confidentiality-protection are not implemented, as
// they are provided by the use of OpenSSL.
- SendCommand("AUTH DIGEST-MD5"CRLF);
+ SendCommand("AUTH DIGEST-MD5" CRLF);
const char *res = fLog.String();

if (strncmp(res, "334", 3) != 0)
@@ -677,7 +677,7 @@ SMTPProtocol::Login(const char *_login, const char
*password)
}
if (fAuthType & CRAM_MD5) {
//******* CRAM-MD5 Authentication ( tested. works fine [with
Cyrus SASL] )
- SendCommand("AUTH CRAM-MD5"CRLF);
+ SendCommand("AUTH CRAM-MD5" CRLF);
const char *res = fLog.String();

if (strncmp(res, "334", 3) != 0)
@@ -715,7 +715,7 @@ SMTPProtocol::Login(const char *_login, const char
*password)
//******* LOGIN Authentication ( tested. works fine)
ssize_t encodedsize; // required by our base64 implementation

- SendCommand("AUTH LOGIN"CRLF);
+ SendCommand("AUTH LOGIN" CRLF);
const char *res = fLog.String();

if (strncmp(res, "334", 3) != 0)
@@ -938,9 +938,9 @@ SMTPProtocol::Send(const char* to, const char* from,
BPositionIO *message)
delete [] data;

if (messageEndedWithCRLF)
- cmd = "."CRLF; // The standard says don't add extra CRLF.
+ cmd = "." CRLF; // The standard says don't add extra CRLF.
else
- cmd = CRLF"."CRLF;
+ cmd = CRLF "." CRLF;

if (SendCommand(cmd.String()) != B_OK)
return B_ERROR;
diff --git a/src/apps/remotedesktop/RemoteView.cpp
b/src/apps/remotedesktop/RemoteView.cpp
index 1f31d75..0693886 100644
--- a/src/apps/remotedesktop/RemoteView.cpp
+++ b/src/apps/remotedesktop/RemoteView.cpp
@@ -39,9 +39,9 @@ static const uint8 kCursorData[] = { 16 /* size, 16x16 */,
};


-#define TRACE(x...) /*printf("RemoteView: "x)*/
-#define TRACE_ALWAYS(x...) printf("RemoteView: "x)
-#define TRACE_ERROR(x...) printf("RemoteView: "x)
+#define TRACE(x...) /*printf("RemoteView: " x)*/
+#define TRACE_ALWAYS(x...) printf("RemoteView: " x)
+#define TRACE_ERROR(x...) printf("RemoteView: " x)


typedef struct engine_state {
diff --git a/src/apps/tv/config.h b/src/apps/tv/config.h
index 85d2075..5ddb5e2 100644
--- a/src/apps/tv/config.h
+++ b/src/apps/tv/config.h
@@ -31,9 +31,9 @@
#define NAME "TV"
#define REVISION "unknown"
#define VERSION "1.1"
-#define BUILD __DATE__ " "__TIME__
-#define COPYRIGHT B_UTF8_COPYRIGHT" Marcus Overhagen 2005-2007"
+#define BUILD __DATE__ " " __TIME__
+#define COPYRIGHT B_UTF8_COPYRIGHT " Marcus Overhagen 2005-2007"
#define INFO1 "DVB - Digital Video Broadcasting TV"
-#define APP_SIG "application/x-vnd.Haiku."NAME
+#define APP_SIG "application/x-vnd.Haiku." NAME

#endif
diff --git a/src/preferences/notifications/GeneralView.cpp
b/src/preferences/notifications/GeneralView.cpp
index 50ca791..55a1f91 100644
--- a/src/preferences/notifications/GeneralView.cpp
+++ b/src/preferences/notifications/GeneralView.cpp
@@ -239,7 +239,8 @@ GeneralView::_CanFindServer(entry_ref* ref)
volume.GetName(volName);

BQuery *query = new BQuery();
-
query->SetPredicate("(BEOS:APP_SIG==\""kNotificationServerSignature"\")");
+ query->SetPredicate("(BEOS:APP_SIG==\""
kNotificationServerSignature
+ "\")");
query->SetVolume(&volume);
query->Fetch();

diff --git a/src/servers/app/drawing/interface/remote/NetReceiver.cpp
b/src/servers/app/drawing/interface/remote/NetReceiver.cpp
index e342066..d88fcfa 100644
--- a/src/servers/app/drawing/interface/remote/NetReceiver.cpp
+++ b/src/servers/app/drawing/interface/remote/NetReceiver.cpp
@@ -16,8 +16,8 @@
#include <stdlib.h>
#include <string.h>

-#define TRACE(x...) /*debug_printf("NetReceiver: "x)*/
-#define TRACE_ERROR(x...) debug_printf("NetReceiver: "x)
+#define TRACE(x...) /*debug_printf("NetReceiver: " x)*/
+#define TRACE_ERROR(x...) debug_printf("NetReceiver: " x)


NetReceiver::NetReceiver(BNetEndpoint *listener, StreamingRingBuffer *target)
diff --git a/src/servers/app/drawing/interface/remote/NetSender.cpp
b/src/servers/app/drawing/interface/remote/NetSender.cpp
index 0d7cca0..4e2dbb3 100644
--- a/src/servers/app/drawing/interface/remote/NetSender.cpp
+++ b/src/servers/app/drawing/interface/remote/NetSender.cpp
@@ -16,8 +16,8 @@
#include <stdlib.h>
#include <string.h>

-#define TRACE(x...) /*debug_printf("NetSender: "x)*/
-#define TRACE_ERROR(x...) debug_printf("NetSender: "x)
+#define TRACE(x...) /*debug_printf("NetSender: " x)*/
+#define TRACE_ERROR(x...) debug_printf("NetSender: " x)


NetSender::NetSender(BNetEndpoint *endpoint, StreamingRingBuffer *source)

############################################################################

Revision: hrev49458
Commit: 4fb4b32043174432f9b12b56f2e20a652ff2091c
URL: http://cgit.haiku-os.org/haiku/commit/?id=4fb4b3204317
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Sat Jul 25 15:28:39 2015 UTC

Force use of std::isnan() in agg_conv_curve.h.

cmath could be included before inclusion of this header, thus undefining isnan.

----------------------------------------------------------------------------

diff --git a/headers/libs/agg/agg_conv_curve.h
b/headers/libs/agg/agg_conv_curve.h
index 751e08d..bc28691 100644
--- a/headers/libs/agg/agg_conv_curve.h
+++ b/headers/libs/agg/agg_conv_curve.h
@@ -23,6 +23,9 @@
#include "agg_basics.h"
#include "agg_curves.h"

+#include <cmath>
+
+
namespace agg
{

@@ -165,8 +168,8 @@ namespace agg
case path_cmd_curve3:
m_source->vertex(&end_x, &end_y);

- if (!isnan(m_last_x) && !isnan(m_last_y) && !isnan(*x)
&& !isnan(*y)
- && !isnan(end_x) && !isnan(end_y)) {
+ if (!std::isnan(m_last_x) && !std::isnan(m_last_y) &&
!std::isnan(*x)
+ && !std::isnan(*y) && !std::isnan(end_x) &&
!std::isnan(end_y)) {
m_curve3.init(m_last_x, m_last_y,
*x, *y,
end_x, end_y);
@@ -181,8 +184,8 @@ namespace agg
m_source->vertex(&ct2_x, &ct2_y);
m_source->vertex(&end_x, &end_y);

- if (!isnan(m_last_x) && !isnan(m_last_y) && !isnan(*x)
&& !isnan(*y)
- && !isnan(end_x) && !isnan(end_y)) {
+ if (!std::isnan(m_last_x) && !std::isnan(m_last_y) &&
!std::isnan(*x)
+ && !std::isnan(*y) && !std::isnan(end_x) &&
!std::isnan(end_y)) {
m_curve4.init(m_last_x, m_last_y,
*x, *y,
ct2_x, ct2_y,


Other related posts: