diff --git a/config.go b/config.go index 65d4f7b..76651f1 100644 --- a/config.go +++ b/config.go @@ -105,9 +105,9 @@ func createConfig(key int, uri *url.URL, config *Config, valueSystem *boltValueS C.BoltConfig_set_routing_context(cConfig, cRoutingContext) C.BoltConfig_set_address_resolver(cConfig, cResolver) C.BoltConfig_set_log(cConfig, cLogger) - C.BoltConfig_set_max_pool_size(cConfig, C.int(config.MaxPoolSize)) - C.BoltConfig_set_max_connection_life_time(cConfig, C.int(config.MaxConnLifetime/time.Millisecond)) - C.BoltConfig_set_max_connection_acquisition_time(cConfig, C.int(config.ConnAcquisitionTimeout/time.Millisecond)) + C.BoltConfig_set_max_pool_size(cConfig, C.int32_t(config.MaxPoolSize)) + C.BoltConfig_set_max_connection_life_time(cConfig, C.int32_t(config.MaxConnLifetime/time.Millisecond)) + C.BoltConfig_set_max_connection_acquisition_time(cConfig, C.int32_t(config.ConnAcquisitionTimeout/time.Millisecond)) C.BoltConfig_set_socket_options(cConfig, cSocketOpts) return cConfig, nil } @@ -135,7 +135,7 @@ func transport(config *Config) C.BoltTransport { func createSocketOptions(config *Config) *C.struct_BoltSocketOptions { var cSocketOpts = C.BoltSocketOptions_create() - C.BoltSocketOptions_set_connect_timeout(cSocketOpts, C.int(config.SockConnectTimeout/time.Millisecond)) + C.BoltSocketOptions_set_connect_timeout(cSocketOpts, C.int32_t(config.SockConnectTimeout/time.Millisecond)) C.BoltSocketOptions_set_keep_alive(cSocketOpts, 1) if !config.SockKeepalive { C.BoltSocketOptions_set_keep_alive(cSocketOpts, 0) diff --git a/value.go b/value.go index 17317c8..833c0ed 100644 --- a/value.go +++ b/value.go @@ -94,7 +94,7 @@ func (valueSystem *boltValueSystem) valueAsFloat(value *C.struct_BoltValue) floa func (valueSystem *boltValueSystem) valueAsString(value *C.struct_BoltValue) string { val := C.BoltString_get(value) - return C.GoStringN(val, C.BoltValue_size(value)) + return C.GoStringN(val, C.int(C.BoltValue_size(value))) } func (valueSystem *boltValueSystem) valueAsDictionary(value *C.struct_BoltValue) (map[string]interface{}, error) { @@ -145,7 +145,7 @@ func (valueSystem *boltValueSystem) structAsList(value *C.struct_BoltValue) ([]i func (valueSystem *boltValueSystem) valueAsBytes(value *C.struct_BoltValue) []byte { val := C.BoltBytes_get_all(value) - return C.GoBytes(unsafe.Pointer(val), C.BoltValue_size(value)) + return C.GoBytes(unsafe.Pointer(val), C.int(C.BoltValue_size(value))) } func (valueSystem *boltValueSystem) valueToConnector(value interface{}) (*C.struct_BoltValue, error) {