gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 104/254: tftp: silence bad-function-cast warning


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 104/254: tftp: silence bad-function-cast warning
Date: Sat, 17 Jun 2017 16:52:16 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.

commit 3661c8aeb0c6b6f5cb935d5b00d5663df4c66821
Author: Marcel Raad <address@hidden>
AuthorDate: Sun May 7 16:26:19 2017 +0200

    tftp: silence bad-function-cast warning
    
    The cases this warns about are handled elsewhere, so just use an
    intermediate variable to silence the warning.
---
 lib/tftp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/tftp.c b/lib/tftp.c
index 098b1bb9a..b2b3efe0c 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -1119,7 +1119,8 @@ static CURLcode tftp_receive_packet(struct connectdata 
*conn)
   }
   else {
     /* The event is given by the TFTP packet time */
-    state->event = (tftp_event_t)getrpacketevent(&state->rpacket);
+    unsigned short event = getrpacketevent(&state->rpacket);
+    state->event = (tftp_event_t)event;
 
     switch(state->event) {
     case TFTP_EVENT_DATA:
@@ -1138,9 +1139,12 @@ static CURLcode tftp_receive_packet(struct connectdata 
*conn)
       }
       break;
     case TFTP_EVENT_ERROR:
-      state->error = (tftp_error_t)getrpacketblock(&state->rpacket);
+    {
+      unsigned short error = getrpacketblock(&state->rpacket);
+      state->error = (tftp_error_t)error;
       infof(data, "%s\n", (const char *)state->rpacket.data+4);
       break;
+    }
     case TFTP_EVENT_ACK:
       break;
     case TFTP_EVENT_OACK:

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]