trivial clang fixes

This commit is contained in:
espie 2017-05-11 16:28:58 +00:00
parent d71c0cf78b
commit 740189bbe6
3 changed files with 59 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.13 2017/04/10 11:46:32 sthen Exp $
# $OpenBSD: Makefile,v 1.14 2017/05/11 16:28:58 espie Exp $
COMMENT= gnutella client with an easy to use interface
@ -18,4 +18,10 @@ SEPARATE_BUILD= Yes
CONFIGURE_STYLE= gnu
.include <bsd.port.mk>
# this warning is dubious for now
.if ${PROPERTIES:Mclang}
CXXFLAGS += -Wno-undefined-var-template
.endif

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-mutella_common_h,v 1.1 2017/05/11 16:28:58 espie Exp $
clang looks at parameter names... twice the same one ? not a good idea.
Index: mutella/common.h
--- mutella/common.h.orig
+++ mutella/common.h
@@ -50,7 +50,7 @@ CString restore_string(CString s, bool bFormMode = tru
bool QueryMatch(CString Result, const CString& Query);
// fast functions which do not copy the string
void MakeWordList(LPSTR szQuery, vector<char*>& QWords);
-void MakeWordList(LPSTR szQuery, vector<char*>& QWords, vector<char*>& QWords);
+void MakeWordList(LPSTR szQuery, vector<char*>&, vector<char*>&);
bool MatchWordList(const CString& ResultLower, const vector<char*>& QWords, bool bMatchAll = true);
// slower but 'storage-independent' versions

View File

@ -0,0 +1,37 @@
$OpenBSD: patch-mutella_uiremote_cpp,v 1.1 2017/05/11 16:28:58 espie Exp $
Index: mutella/uiremote.cpp
--- mutella/uiremote.cpp.orig
+++ mutella/uiremote.cpp
@@ -575,11 +575,11 @@ bool MUIRemotePriv::on_http_request(const IP& ipRemote
{
// login -- HTTP-Basic so far
bool bLoginOK = false;
- char * pszAuth = NULL;
+ const char * pszAuth = NULL;
if ( (pszAuth = strstr(szHandshake, "Authorization:")) )
{
// extract authorization line
- char * pRN = strstr(pszAuth, "\r\n");
+ const char * pRN = strstr(pszAuth, "\r\n");
CString sAuthLine(pszAuth + strlen("Authorization:"), pRN-pszAuth-strlen("Authorization:"));
int nPos = sAuthLine.find("Basic");
if (nPos>=0)
@@ -616,7 +616,7 @@ bool MUIRemotePriv::on_http_request(const IP& ipRemote
const char* pszCookie;
if( (pszCookie = strstr(szHandshake, "Cookie:")) )
{
- char * pRN = strstr(pszCookie, "\r\n");
+ const char * pRN = strstr(pszCookie, "\r\n");
CString sCookieLine(pszCookie + strlen("Cookie:"), pRN-pszCookie-strlen("Cookie:"));
// we will split the line by "; " combination
list<CString> Cookies;
@@ -1288,7 +1288,7 @@ enum TagResolv{
#define TAG_ENVLISTITEM "#ENVLISTITEM#"
struct STagEntry{
- char* tag;
+ const char* tag;
TagResolv res;
};