cleans surprisingly well for something that includes iostream.h

builds with clang
This commit is contained in:
espie 2017-05-04 15:46:56 +00:00
parent fbfbf1405a
commit 120fbc3d18
17 changed files with 238 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.19 2017/02/27 15:50:17 jca Exp $
# $OpenBSD: Makefile,v 1.20 2017/05/04 15:46:56 espie Exp $
COMMENT= C++ class library for MIME messages
DISTNAME= mimepp-1.0
REVISION= 0
REVISION= 1
CATEGORIES= converters
PERMIT_PACKAGE_CDROM= restrictive non-commercial license

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-body_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: body.cpp
--- body.cpp.orig
+++ body.cpp
@@ -30,7 +30,7 @@
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
#include <mimepp/string.h>
#include <mimepp/headers.h>
#include <mimepp/bodypart.h>

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-bodypart_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: bodypart.cpp
--- bodypart.cpp.orig
+++ bodypart.cpp
@@ -30,7 +30,7 @@
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
-#include <iostream.h>
+#include <iostream>
#include <mimepp/string.h>
#include <mimepp/headers.h>
#include <mimepp/bodypart.h>

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-dw_cte_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: dw_cte.cpp
--- dw_cte.cpp.orig
+++ dw_cte.cpp
@@ -420,7 +420,7 @@ static int encode_base64(const char* aIn, size_t aInLe
out[outPos++] = base64tab[c3 & 0x3F];
lineLen += 4;
if (lineLen >= MAXLINE-3) {
- char* cp = DW_EOL;
+ const char* cp = DW_EOL;
out[outPos++] = *cp++;
if (*cp) {
out[outPos++] = *cp;
@@ -429,7 +429,7 @@ static int encode_base64(const char* aIn, size_t aInLe
}
}
/* Encode the remaining one or two characters. */
- char* cp;
+ const char* cp;
switch (inLen % 3) {
case 0:
cp = DW_EOL;

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-field_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: field.cpp
--- field.cpp.orig
+++ field.cpp
@@ -28,7 +28,7 @@
#include <mimepp/debug.h>
#include <assert.h>
#include <ctype.h>
-#include <iostream.h>
+#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <mimepp/string.h>

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-headers_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: headers.cpp
--- headers.cpp.orig
+++ headers.cpp
@@ -30,7 +30,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include <iostream.h>
+#include <iostream>
#include <mimepp/string.h>
#include <mimepp/headers.h>
#include <mimepp/field.h>

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-mailbox_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: mailbox.cpp
--- mailbox.cpp.orig
+++ mailbox.cpp
@@ -29,7 +29,7 @@
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
-#include <iostream.h>
+#include <iostream>
#include <mimepp/string.h>
#include <mimepp/mailbox.h>
#include <mimepp/token.h>

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-mboxlist_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: mboxlist.cpp
--- mboxlist.cpp.orig
+++ mboxlist.cpp
@@ -29,7 +29,7 @@
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
-#include <iostream.h>
+#include <iostream>
#include <mimepp/string.h>
#include <mimepp/mailbox.h>
#include <mimepp/mboxlist.h>

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-mediatyp_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: mediatyp.cpp
--- mediatyp.cpp.orig
+++ mediatyp.cpp
@@ -29,7 +29,7 @@
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
-#include <iostream.h>
+#include <iostream>
#include <mimepp/string.h>
#include <mimepp/param.h>
#include <mimepp/mediatyp.h>

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-mimepp_field_h,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: mimepp/field.h
--- mimepp/field.h.orig
+++ mimepp/field.h
@@ -25,7 +25,7 @@
#ifndef DW_FIELD_H
#define DW_FIELD_H
-#include <iostream.h>
+#include <iostream>
#ifndef DW_CONFIG_H
#include <mimepp/config.h>

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-mimepp_fieldbdy_h,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: mimepp/fieldbdy.h
--- mimepp/fieldbdy.h.orig
+++ mimepp/fieldbdy.h
@@ -25,7 +25,7 @@
#ifndef DW_FIELDBDY_H
#define DW_FIELDBDY_H
-#include <iostream.h>
+#include <iostream>
#ifndef DW_CONFIG_H
#include <mimepp/config.h>

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-mimepp_headers_h,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: mimepp/headers.h
--- mimepp/headers.h.orig
+++ mimepp/headers.h
@@ -25,7 +25,7 @@
#ifndef DW_HEADERS_H
#define DW_HEADERS_H
-#include <iostream.h>
+#include <iostream>
#ifndef DW_CONFIG_H
#include <mimepp/config.h>

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-mimepp_string_h,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: mimepp/string.h
--- mimepp/string.h.orig
+++ mimepp/string.h
@@ -27,7 +27,9 @@
#include <assert.h>
#include <stddef.h>
-#include <iostream.h>
+#include <iostream>
+using std::ostream;
+using std::istream;
#ifndef DW_CONFIG_H
#include <mimepp/config.h>

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-msgcmp_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: msgcmp.cpp
--- msgcmp.cpp.orig
+++ msgcmp.cpp
@@ -28,6 +28,7 @@
#include <mimepp/debug.h>
#include <stdlib.h>
#include <mimepp/msgcmp.h>
+using std::cerr;
#define kMagicNumber ((DwUint32) 0x22222222L)

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-proto_un_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: proto_un.cpp
--- proto_un.cpp.orig
+++ proto_un.cpp
@@ -37,7 +37,7 @@
#include <assert.h>
#include <stdio.h>
#include <string.h>
-#include <iostream.h>
+#include <iostream>
#include <unistd.h>
#include <netdb.h>
#include <arpa/inet.h>

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-string_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: string.cpp
--- string.cpp.orig
+++ string.cpp
@@ -29,8 +29,9 @@
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
-#include <new.h>
+#include <new>
#include <mimepp/string.h>
+using std::cerr;
#define DW_MIN(a,b) ((a) <= (b) ? (a) : (b))
#define DW_MAX(a,b) ((a) >= (b) ? (a) : (b))

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-token_cpp,v 1.1 2017/05/04 15:46:56 espie Exp $
Index: token.cpp
--- token.cpp.orig
+++ token.cpp
@@ -224,7 +224,7 @@ void DwTokenizer::ParseDomainLiteral()
void DwTokenizer::PrintToken(ostream* aOut)
{
if (!aOut) return;
- char* type = 0;
+ const char* type = 0;
switch (mTkType) {
case eTkError:
type = "error ";