Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifications to allow building of toolset in OpenBSD #1392

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/st-flash/flash_opts.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <helper.h>

static bool starts_with(const char * str, const char * prefix) {
uint32_t n = strlen(prefix);
uint32_t n = (uint32_t)strlen(prefix);

if (strlen(str) < n) { return (false); }

Expand Down Expand Up @@ -70,7 +70,7 @@ static int32_t get_integer_from_char_array (const char *const str, uint32_t *rea
fprintf (stderr, "*** Error: Integer greater than UINT32_MAX, cannot convert to int32_t\n");
return (-1);
} else {
*read_value = value;
*read_value = (uint32_t)value;
return (0);
}
}
Expand Down Expand Up @@ -199,7 +199,7 @@ int32_t flash_get_opts(struct flash_opts* o, int32_t ac, char** av) {
if (result != 0) {
return (bad_arg ("--flash"));
} else {
o->flash_size = (size_t)flash_size;
o->flash_size = (uint32_t)flash_size;
}
} else if (strcmp(av[0], "--connect-under-reset") == 0) {
o->connect = CONNECT_UNDER_RESET;
Expand Down Expand Up @@ -259,7 +259,7 @@ int32_t flash_get_opts(struct flash_opts* o, int32_t ac, char** av) {
if (result != 0) {
return bad_arg ("size");
} else {
o->size = (size_t) size;
o->size = (uint32_t) size;
}
}

Expand All @@ -283,7 +283,7 @@ int32_t flash_get_opts(struct flash_opts* o, int32_t ac, char** av) {
if (result != 0) {
return bad_arg ("size");
} else {
o->size = (size_t) size;
o->size = (uint32_t) size;
}

break;
Expand All @@ -300,7 +300,7 @@ int32_t flash_get_opts(struct flash_opts* o, int32_t ac, char** av) {
if (result != 0) {
return bad_arg("option bytes read: invalid size");
} else {
o->size = (size_t) size;
o->size = (uint32_t) size;
}
}
break;
Expand Down
2 changes: 1 addition & 1 deletion src/st-info/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void stlink_probe(enum connect_type connect, int32_t freq) {
stlink_t **stdevs;
uint32_t size;

size = stlink_probe_usb(&stdevs, connect, freq);
size = (uint32_t)stlink_probe_usb(&stdevs, connect, freq);

printf("Found %u stlink programmers\n", size);

Expand Down
2 changes: 1 addition & 1 deletion src/st-util/gdb-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ int32_t serve(stlink_t *sl, st_state_t *st) {
params = separator + 1;
}

uint32_t hex_len = strlen(params);
uint32_t hex_len = (uint32_t)strlen(params);
uint32_t alloc_size = (hex_len / 2) + 1;
uint32_t cmd_len;
char *cmd = malloc(alloc_size);
Expand Down
2 changes: 1 addition & 1 deletion src/stlink-lib/chipid.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void init_chipids(char *dir_to_scan) {

if (d) {
while ((dir = readdir(d)) != NULL) {
nl = strlen(dir->d_name);
nl = (uint32_t)strlen(dir->d_name);

if (strcmp(dir->d_name + nl - 5, ".chip") == 0) {
char buf[1024];
Expand Down
2 changes: 1 addition & 1 deletion src/stlink-lib/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ int32_t stlink_parse_ihex(const char *path, uint8_t erased_pattern, uint8_t **me
break;
}

uint32_t l = strlen(line);
uint32_t l = (uint32_t)strlen(line);

while (l > 0 && (line[l - 1] == '\n' || line[l - 1] == '\r')) {
--l;
Expand Down
2 changes: 1 addition & 1 deletion src/stlink-lib/flash_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ int32_t stlink_flashloader_write(stlink_t *sl, flash_loader_t *fl, stm32_addr_t
if (stm32l1_write_half_pages(sl, fl, addr, base, len, pagesize)) {
return (-1);
} else {
off = (size_t)(len / pagesize) * pagesize;
off = (uint32_t)(len / pagesize) * pagesize;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/stlink-lib/map_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int32_t map_file(mapped_file_t *mf, const char *path) {
goto on_error;
}

mf->len = (size_t)st.st_size;
mf->len = (uint32_t)st.st_size;
error = 0; // success

on_error:
Expand Down
4 changes: 2 additions & 2 deletions src/stlink-lib/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ stlink_t *stlink_open_usb(enum ugly_loglevel verbose, enum connect_type connect,

if (ret) { continue; } // could not open device

uint32_t serial_len = stlink_serial(handle, &desc, sl->serial);
uint32_t serial_len = (uint32_t)stlink_serial(handle, &desc, sl->serial);
Nightwalker-87 marked this conversation as resolved.
Show resolved Hide resolved

libusb_close(handle);

Expand Down Expand Up @@ -1375,7 +1375,7 @@ static uint32_t stlink_probe_usb_devs(libusb_device **devs, stlink_t **sldevs[],
break;
}

uint32_t serial_len = stlink_serial(handle, &desc, serial);
uint32_t serial_len = (uint32_t)stlink_serial(handle, &desc, serial);
Nightwalker-87 marked this conversation as resolved.
Show resolved Hide resolved

libusb_close(handle);

Expand Down
Loading