]> granicus.if.org Git - curl/commitdiff
Compiler warning fix
authorYang Tse <yangsita@gmail.com>
Sun, 29 Oct 2006 21:19:23 +0000 (21:19 +0000)
committerYang Tse <yangsita@gmail.com>
Sun, 29 Oct 2006 21:19:23 +0000 (21:19 +0000)
docs/examples/curlx.c
tests/libtest/lib509.c

index 1ee384ff27432e9e8eeb6c87860233bbcaf6c209..31f01e8ad4f845973020fd692fa4a14dbb08f275 100644 (file)
@@ -114,6 +114,13 @@ static char *curlx_usage[]={
 
 */
 
+/* 
+ * We use this ZERO_NULL to avoid picky compiler warnings,
+ * when assigning a NULL pointer to a function pointer var.
+ */
+
+#define ZERO_NULL 0
+
 /* This is a context that we pass to all callbacks */
 
 typedef struct sslctxparm_st {
@@ -236,7 +243,7 @@ static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm) {
 
   SSL_CTX_set_verify_depth(ctx,2);
 
-  SSL_CTX_set_verify(ctx,SSL_VERIFY_PEER,NULL);
+  SSL_CTX_set_verify(ctx,SSL_VERIFY_PEER,ZERO_NULL);
 
   SSL_CTX_set_cert_verify_callback(ctx, ssl_app_verify_callback, parm);
 
index a21fae4a44ac4d4a360c8d1921077b79b2107f71..a911e36540a85f675ce76be4028e3dd5d0d34df3 100644 (file)
 #define MAIN_LOOP_HANG_TIMEOUT     30 * 1000
 #define MULTI_PERFORM_HANG_TIMEOUT 20 * 1000
 
+/* 
+ * We use this ZERO_NULL to avoid picky compiler warnings,
+ * when assigning a NULL pointer to a function pointer var.
+ */
+
+#define ZERO_NULL 0
+
 int portnum; /* the HTTPS port number we use */
 
 typedef struct sslctxparm_st {
@@ -165,7 +172,7 @@ static CURLcode sslctxfun(CURL * curl, void * sslctx, void * parm)
    but it still does, see the error handling in the call back */
 
   SSL_CTX_set_verify_depth(ctx,0);
-  SSL_CTX_set_verify(ctx,SSL_VERIFY_NONE,NULL);
+  SSL_CTX_set_verify(ctx,SSL_VERIFY_NONE,ZERO_NULL);
 
 #if OPENSSL_VERSION_NUMBER<0x00907000L
 /* in newer openssl versions we can set a parameter for the call back. */