1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

Use specific macros for portability to OS/400

Some of the entry points for POSIX networking calls in OS/400
differs slightly due to not using const arguments
This commit is contained in:
Patrick Monnerat 2013-12-12 15:23:09 +08:00 committed by Daniel Veillard
parent d1c0cc9908
commit 437f4f5977
2 changed files with 19 additions and 19 deletions

View File

@ -775,7 +775,7 @@ xmlNanoFTPSendUser(void *ctx) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
return(res);
@ -803,7 +803,7 @@ xmlNanoFTPSendPasswd(void *ctx) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
return(res);
@ -834,7 +834,7 @@ xmlNanoFTPQuit(void *ctx) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf); /* Just to be consistent, even though we know it can't have a % in it */
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
return(res);
@ -928,9 +928,9 @@ xmlNanoFTPConnect(void *ctx) {
#endif
{
if (proxy)
hp = gethostbyname (proxy);
hp = gethostbyname (GETHOSTBYNAME_ARG_CAST proxy);
else
hp = gethostbyname (ctxt->hostname);
hp = gethostbyname (GETHOSTBYNAME_ARG_CAST ctxt->hostname);
if (hp == NULL) {
__xmlIOErr(XML_FROM_FTP, 0, "gethostbyname failed");
return (-1);
@ -1028,7 +1028,7 @@ xmlNanoFTPConnect(void *ctx) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->controlFd);
@ -1050,7 +1050,7 @@ xmlNanoFTPConnect(void *ctx) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->controlFd);
@ -1091,7 +1091,7 @@ xmlNanoFTPConnect(void *ctx) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->controlFd); ctxt->controlFd = INVALID_SOCKET;
@ -1122,7 +1122,7 @@ xmlNanoFTPConnect(void *ctx) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->controlFd); ctxt->controlFd = INVALID_SOCKET;
@ -1144,7 +1144,7 @@ xmlNanoFTPConnect(void *ctx) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->controlFd); ctxt->controlFd = INVALID_SOCKET;
@ -1288,7 +1288,7 @@ xmlNanoFTPCwd(void *ctx, const char *directory) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
return(res);
@ -1339,7 +1339,7 @@ xmlNanoFTPDele(void *ctx, const char *file) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
return(res);
@ -1411,7 +1411,7 @@ xmlNanoFTPGetConnection(void *ctx) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->dataFd); ctxt->dataFd = INVALID_SOCKET;
@ -1512,7 +1512,7 @@ xmlNanoFTPGetConnection(void *ctx) {
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->dataFd); ctxt->dataFd = INVALID_SOCKET;
@ -1749,7 +1749,7 @@ xmlNanoFTPList(void *ctx, ftpListCallback callback, void *userData,
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->dataFd); ctxt->dataFd = INVALID_SOCKET;
@ -1844,7 +1844,7 @@ xmlNanoFTPGetSocket(void *ctx, const char *filename) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->dataFd); ctxt->dataFd = INVALID_SOCKET;
@ -1864,7 +1864,7 @@ xmlNanoFTPGetSocket(void *ctx, const char *filename) {
#ifdef DEBUG_FTP
xmlGenericError(xmlGenericErrorContext, "%s", buf);
#endif
res = send(ctxt->controlFd, buf, len, 0);
res = send(ctxt->controlFd, SEND_ARG2_CAST buf, len, 0);
if (res < 0) {
__xmlIOErr(XML_FROM_FTP, 0, "send failed");
closesocket(ctxt->dataFd); ctxt->dataFd = INVALID_SOCKET;

View File

@ -461,7 +461,7 @@ xmlNanoHTTPSend(xmlNanoHTTPCtxtPtr ctxt, const char *xmt_ptr, int outlen)
if ((ctxt->state & XML_NANO_HTTP_WRITE) && (xmt_ptr != NULL)) {
while (total_sent < outlen) {
int nsent = send(ctxt->fd, xmt_ptr + total_sent,
int nsent = send(ctxt->fd, SEND_ARG2_CAST (xmt_ptr + total_sent),
outlen - total_sent, 0);
if (nsent > 0)
@ -1122,7 +1122,7 @@ xmlNanoHTTPConnectHost(const char *host, int port)
#endif
#if !defined(HAVE_GETADDRINFO) || !defined(_WIN32)
{
h = gethostbyname (host);
h = gethostbyname (GETHOSTBYNAME_ARG_CAST host);
if (h == NULL) {
/*