@@ -614,7 +614,7 @@ static inline void free_params(const char * const *params, size_t nparams)
614
614
static inline const char * const * copy_params_shallow (
615
615
value v_params , size_t nparams )
616
616
{
617
- char * * params ;
617
+ const char * * params ;
618
618
size_t i ;
619
619
if (nparams == 0 ) return NULL ;
620
620
params = caml_stat_alloc (nparams * sizeof (char * ));
@@ -917,7 +917,7 @@ CAMLprim value PQgetescval_stub(value v_res, intnat tup_num, intnat field_num)
917
917
str += 2 ;
918
918
n_hex_pairs = bytea_hex_pairs (str );
919
919
v_str = caml_alloc_string (n_hex_pairs );
920
- decode_bytea_hex (str , String_val (v_str ), n_hex_pairs );
920
+ decode_bytea_hex (str , ( char * ) String_val (v_str ), n_hex_pairs );
921
921
}
922
922
} else {
923
923
/* Assume binary format! */
@@ -1193,7 +1193,8 @@ CAMLprim value PQunescapeBytea_stub(value v_from)
1193
1193
CAMLparam1 (v_from );
1194
1194
value v_res = caml_alloc_string (res_len );
1195
1195
/* GC may have happened, have to use String_val on v_from again */
1196
- decode_bytea_hex (String_val (v_from ) + 2 , String_val (v_res ), res_len );
1196
+ decode_bytea_hex (
1197
+ String_val (v_from ) + 2 , (char * ) String_val (v_res ), res_len );
1197
1198
CAMLreturn (v_res );
1198
1199
}
1199
1200
}
@@ -1316,7 +1317,7 @@ CAMLprim intnat PQgetline_stub(
1316
1317
caml_enter_blocking_section ();
1317
1318
res = PQgetline (conn , buf , len );
1318
1319
caml_leave_blocking_section ();
1319
- memcpy (String_val (v_buf ) + pos , buf , len );
1320
+ memcpy (Bytes_val (v_buf ) + pos , buf , len );
1320
1321
caml_stat_free (buf );
1321
1322
CAMLreturn (res );
1322
1323
}
@@ -1330,7 +1331,8 @@ CAMLprim value PQgetline_stub_bc(
1330
1331
CAMLprim intnat PQgetlineAsync_stub (
1331
1332
value v_conn , value v_buf , intnat pos , intnat len )
1332
1333
{
1333
- return PQgetlineAsync (get_conn (v_conn ), String_val (v_buf ) + pos , len );
1334
+ return PQgetlineAsync (
1335
+ get_conn (v_conn ), (char * ) String_val (v_buf ) + pos , len );
1334
1336
}
1335
1337
1336
1338
CAMLprim value PQgetlineAsync_stub_bc (
@@ -1578,7 +1580,7 @@ CAMLprim intnat lo_read_stub(
1578
1580
caml_enter_blocking_section ();
1579
1581
res = lo_read (conn , fd , buf , len );
1580
1582
caml_leave_blocking_section ();
1581
- memcpy (String_val (v_buf ) + pos , buf , len );
1583
+ memcpy (Bytes_val (v_buf ) + pos , buf , len );
1582
1584
caml_stat_free (buf );
1583
1585
CAMLreturn (res );
1584
1586
}
0 commit comments