Browse Source

more gcc warnings

ncannasse 7 years ago
parent
commit
fb5c64877f
2 changed files with 6 additions and 6 deletions
  1. 2 2
      libs/ssl/ssl.c
  2. 4 4
      src/std/cast.c

+ 2 - 2
libs/ssl/ssl.c

@@ -567,7 +567,7 @@ HL_PRIM hl_ssl_pkey *HL_NAME(key_from_pem)(vbyte *data, bool pub, vbyte *pass) {
 	else if (pass == NULL)
 		r = mbedtls_pk_parse_key(pk, buf, len, NULL, 0);
 	else
-		r = mbedtls_pk_parse_key(pk, buf, len, (const unsigned char*)pass, strlen(pass));
+		r = mbedtls_pk_parse_key(pk, buf, len, (const unsigned char*)pass, strlen((char*)pass));
 	free(buf);
 	if (r != 0) {
 		mbedtls_pk_free(pk);
@@ -612,7 +612,7 @@ HL_PRIM vbyte *HL_NAME(dgst_sign)(vbyte *data, int len, hl_ssl_pkey *key, vbyte
 	unsigned char hash[MBEDTLS_MD_MAX_SIZE];
 	size_t ssize = size ? *size : 0;
 
-	md = mbedtls_md_info_from_string(alg);
+	md = mbedtls_md_info_from_string((char*)alg);
 	if (md == NULL) {
 		hl_error("Invalid hash algorithm");
 		return NULL;

+ 4 - 4
src/std/cast.c

@@ -25,13 +25,13 @@
 #define TK2(a,b)		((a) | ((b)<<5))
 
 #ifndef HL_64
-#	define INIT_DYN(t,v) { t, 0, v }
+#	define DYN_PAD	0,
 #else
-#	define INIT_DYN(t,v) { t, v }
+#	define DYN_PAD
 #endif
 
-static vdynamic vdyn_true = INIT_DYN( &hlt_bool, true );
-static vdynamic vdyn_false = INIT_DYN( &hlt_bool, false );
+static vdynamic vdyn_true = { &hlt_bool, DYN_PAD {true} };
+static vdynamic vdyn_false = { &hlt_bool, DYN_PAD {false} };
 
 static void invalid_cast( hl_type *from, hl_type *to ) {
 	hl_error_msg(USTR("Can't cast %s to %s"),hl_type_str(from),hl_type_str(to));