Changeset 33b8d024 in mainline
- Timestamp:
- 2018-01-16T20:38:46Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2467b41
- Parents:
- d39c46e0
- Location:
- uspace
- Files:
-
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/compl.c
rd39c46e0 r33b8d024 69 69 70 70 /** Pointer inside list of directories */ 71 const char * *path;71 const char *const *path; 72 72 /** If not @c NULL, should be freed in the end. */ 73 c onst char **path_list;73 char **path_list; 74 74 /** Current open directory */ 75 75 DIR *dir; … … 219 219 cs->path_list[0] = dirname; 220 220 cs->path_list[1] = NULL; 221 cs->path = cs->path_list; 221 /* The second const ensures that we can't assign a const 222 * string to the non-const array. */ 223 cs->path = (const char *const *) cs->path_list; 222 224 223 225 } else if (cs->is_command) { -
uspace/app/edit/search_impl.h
rd39c46e0 r33b8d024 43 43 /* Note: This structure is opaque for the user. */ 44 44 45 constwchar_t *pattern;45 wchar_t *pattern; 46 46 size_t pattern_length; 47 47 ssize_t *back_table; -
uspace/app/mixerctl/mixerctl.c
rd39c46e0 r33b8d024 49 49 static void print_levels(async_exch_t *exch) 50 50 { 51 c onst char* name = NULL;51 char* name = NULL; 52 52 unsigned count = 0; 53 53 errno_t ret = audio_mixer_get_info(exch, &name, &count); … … 59 59 60 60 for (unsigned i = 0; i < count; ++i) { 61 c onst char *name = NULL;61 char *name = NULL; 62 62 unsigned levels = 0, current = 0; 63 63 errno_t ret = -
uspace/app/wavplay/dplay.c
rd39c46e0 r33b8d024 353 353 } 354 354 355 c onst char* info = NULL;355 char* info = NULL; 356 356 ret = audio_pcm_get_info_str(session, &info); 357 357 if (ret != EOK) { -
uspace/app/wavplay/drec.c
rd39c46e0 r33b8d024 195 195 } 196 196 197 c onst char* info = NULL;197 char* info = NULL; 198 198 ret = audio_pcm_get_info_str(session, &info); 199 199 if (ret != EOK) { -
uspace/drv/bus/usb/vhc/hub/virthub.c
rd39c46e0 r33b8d024 156 156 dev->descriptors = &descriptors; 157 157 dev->address = 0; 158 dev->name = str_dup(name); 159 if (!dev->name) 158 159 char *n = str_dup(name); 160 if (!n) 160 161 return ENOMEM; 161 162 162 163 hub_t *hub = malloc(sizeof(hub_t)); 163 164 if (hub == NULL) { 164 free( dev->name);165 free(n); 165 166 return ENOMEM; 166 167 } 167 168 169 dev->name = n; 168 170 hub_init(hub); 169 171 dev->device_data = hub; -
uspace/drv/platform/amdm37x/main.c
rd39c46e0 r33b8d024 49 49 typedef struct { 50 50 const char *name; 51 match_id_t match_id; 51 const char *id; 52 int score; 52 53 hw_resource_list_t hw_resources; 53 54 } amdm37x_fun_t; … … 133 134 { 134 135 .name = "ohci", 135 .match_id = { .id = "usb/host=ohci", .score = 90 }, 136 .id = "usb/host=ohci", 137 .score = 90, 136 138 .hw_resources = { .resources = ohci_res, .count = ARRAY_SIZE(ohci_res) } 137 139 }, 138 140 { 139 141 .name = "ehci", 140 .match_id = { .id = "usb/host=ehci", .score = 90 }, 142 .id = "usb/host=ehci", 143 .score = 90, 141 144 .hw_resources = { .resources = ehci_res, .count = ARRAY_SIZE(ehci_res) } 142 145 }, 143 146 { 144 147 .name = "fb", 145 .match_id = { .id = "amdm37x&dispc", .score = 90 }, 148 .id = "amdm37x&dispc", 149 .score = 90, 146 150 .hw_resources = { .resources = disp_res, .count = ARRAY_SIZE(disp_res) } 147 151 }, … … 174 178 175 179 /* Add match id */ 176 errno_t ret = ddf_fun_add_match_id(fnode, 177 fun->match_id.id, fun->match_id.score); 180 errno_t ret = ddf_fun_add_match_id(fnode, fun->id, fun->score); 178 181 if (ret != EOK) { 179 182 ddf_fun_destroy(fnode); -
uspace/lib/c/generic/malloc.c
rd39c46e0 r33b8d024 874 874 * 875 875 */ 876 void *realloc( const void *addr, const size_t size)876 void *realloc(void * const addr, const size_t size) 877 877 { 878 878 if (size == 0) { … … 988 988 * 989 989 */ 990 void free( const void *addr)990 void free(void * const addr) 991 991 { 992 992 if (addr == NULL) -
uspace/lib/c/include/ipc/devman.h
rd39c46e0 r33b8d024 74 74 /** Id of device model. 75 75 */ 76 c onst char *id;76 char *id; 77 77 /** Relevancy of device-to-driver match. 78 78 * The higher is the product of scores specified for the device by the bus driver and by the leaf driver, -
uspace/lib/c/include/malloc.h
rd39c46e0 r33b8d024 38 38 #include <stddef.h> 39 39 40 extern void *malloc( constsize_t size)40 extern void *malloc(size_t size) 41 41 __attribute__((malloc)); 42 extern void *calloc( const size_t nmemb, constsize_t size)42 extern void *calloc(size_t nmemb, size_t size) 43 43 __attribute__((malloc)); 44 extern void *memalign( const size_t align, constsize_t size)44 extern void *memalign(size_t align, size_t size) 45 45 __attribute__((malloc)); 46 extern void *realloc( const void *addr, constsize_t size)46 extern void *realloc(void *addr, size_t size) 47 47 __attribute__((warn_unused_result)); 48 extern void free( constvoid *addr);48 extern void free(void *addr); 49 49 extern void *heap_check(void); 50 50 -
uspace/lib/drv/generic/private/driver.h
rd39c46e0 r33b8d024 57 57 58 58 /** Device name */ 59 c onst char *name;59 char *name; 60 60 61 61 /** Driver-specific data associated with this device */ … … 84 84 85 85 /** Function name */ 86 c onst char *name;86 char *name; 87 87 88 88 /** List of device ids for driver matching */ -
uspace/lib/drv/generic/remote_audio_mixer.c
rd39c46e0 r33b8d024 94 94 * @return Error code. 95 95 */ 96 errno_t audio_mixer_get_info(async_exch_t *exch, c onst char **name, unsigned *items)96 errno_t audio_mixer_get_info(async_exch_t *exch, char **name, unsigned *items) 97 97 { 98 98 if (!exch) … … 131 131 */ 132 132 errno_t audio_mixer_get_item_info(async_exch_t *exch, unsigned item, 133 c onst char **name, unsigned *levels)133 char **name, unsigned *levels) 134 134 { 135 135 if (!exch) -
uspace/lib/drv/generic/remote_audio_pcm.c
rd39c46e0 r33b8d024 184 184 * @note Caller is responsible for freeing newly allocated memory. 185 185 */ 186 errno_t audio_pcm_get_info_str(audio_pcm_sess_t *sess, c onst char **name)186 errno_t audio_pcm_get_info_str(audio_pcm_sess_t *sess, char **name) 187 187 { 188 188 if (!name) -
uspace/lib/drv/include/audio_mixer_iface.h
rd39c46e0 r33b8d024 43 43 #include "ddf/driver.h" 44 44 45 errno_t audio_mixer_get_info(async_exch_t *, c onst char **, unsigned *);45 errno_t audio_mixer_get_info(async_exch_t *, char **, unsigned *); 46 46 errno_t audio_mixer_get_item_info(async_exch_t *, unsigned, 47 c onst char **, unsigned *);47 char **, unsigned *); 48 48 errno_t audio_mixer_get_item_level(async_exch_t *, unsigned, unsigned *); 49 49 errno_t audio_mixer_set_item_level(async_exch_t *, unsigned, unsigned); -
uspace/lib/drv/include/audio_pcm_iface.h
rd39c46e0 r33b8d024 80 80 void audio_pcm_close(audio_pcm_sess_t *); 81 81 82 errno_t audio_pcm_get_info_str(audio_pcm_sess_t *, c onst char **);82 errno_t audio_pcm_get_info_str(audio_pcm_sess_t *, char **); 83 83 errno_t audio_pcm_test_format(audio_pcm_sess_t *, unsigned *, unsigned *, 84 84 pcm_sample_format_t *); -
uspace/lib/hound/include/hound/client.h
rd39c46e0 r33b8d024 57 57 58 58 errno_t hound_context_get_available_targets(hound_context_t *hound, 59 c onst char ***names, size_t *count);59 char ***names, size_t *count); 60 60 errno_t hound_context_get_connected_targets(hound_context_t *hound, 61 c onst char ***names, size_t *count);61 char ***names, size_t *count); 62 62 63 63 errno_t hound_context_connect_target(hound_context_t *hound, const char* target); -
uspace/lib/hound/include/hound/protocol.h
rd39c46e0 r33b8d024 65 65 errno_t hound_service_unregister_context(hound_sess_t *sess, hound_context_id_t id); 66 66 67 errno_t hound_service_get_list(hound_sess_t *sess, c onst char ***ids, size_t *count,67 errno_t hound_service_get_list(hound_sess_t *sess, char ***ids, size_t *count, 68 68 int flags, const char *connection); 69 69 … … 77 77 */ 78 78 static inline errno_t hound_service_get_list_all(hound_sess_t *sess, 79 c onst char ***ids, size_t *count, int flags)79 char ***ids, size_t *count, int flags) 80 80 { 81 81 return hound_service_get_list(sess, ids, count, flags, NULL); … … 106 106 bool (*is_record_context)(void *, hound_context_id_t); 107 107 /** Get string identifiers of specified objects */ 108 errno_t (*get_list)(void *, c onst char ***, size_t *, const char *, int);108 errno_t (*get_list)(void *, char ***, size_t *, const char *, int); 109 109 /** Create connection between source and sink */ 110 110 errno_t (*connect)(void *, const char *, const char *); -
uspace/lib/hound/src/client.c
rd39c46e0 r33b8d024 76 76 hound_sess_t *session; 77 77 /** context name, reported to the daemon */ 78 c onst char *name;78 char *name; 79 79 /** True if the instance is record context */ 80 80 bool record; … … 196 196 */ 197 197 errno_t hound_context_get_available_targets(hound_context_t *hound, 198 c onst char ***names, size_t *count)198 char ***names, size_t *count) 199 199 { 200 200 assert(hound); … … 213 213 */ 214 214 errno_t hound_context_get_connected_targets(hound_context_t *hound, 215 c onst char ***names, size_t *count)215 char ***names, size_t *count) 216 216 { 217 217 assert(hound); … … 237 237 assert(target); 238 238 239 c onst char **tgt = NULL;239 char **tgt = NULL; 240 240 size_t count = 1; 241 241 errno_t ret = EOK; -
uspace/lib/hound/src/protocol.c
rd39c46e0 r33b8d024 173 173 * @retval Error code. 174 174 */ 175 errno_t hound_service_get_list(hound_sess_t *sess, c onst char ***ids, size_t *count,175 errno_t hound_service_get_list(hound_sess_t *sess, char ***ids, size_t *count, 176 176 int flags, const char *connection) 177 177 { … … 206 206 207 207 /* Start receiving names */ 208 c onst char **names = NULL;208 char **names = NULL; 209 209 if (name_count) { 210 210 size_t *sizes = calloc(name_count, sizeof(size_t)); … … 446 446 } 447 447 448 c onst char **list = NULL;448 char **list = NULL; 449 449 const int flags = IPC_GET_ARG1(call); 450 450 size_t count = IPC_GET_ARG2(call); -
uspace/lib/nic/include/nic.h
rd39c46e0 r33b8d024 57 57 nic_wv_id_t id; 58 58 nic_wv_type_t type; 59 constvoid *data;59 void *data; 60 60 size_t length; 61 61 struct nic_wol_virtue *next; -
uspace/lib/posix/source/stdio/scanf.c
rd39c46e0 r33b8d024 625 625 626 626 const char *cur_borrowed = NULL; 627 char *cur_duplicated = NULL; 627 628 const char *cur_limited = NULL; 628 c har *cur_updated = NULL;629 const char *cur_updated = NULL; 629 630 630 631 /* Borrow the cursor. Until it is returned to the provider … … 637 638 * than allowed by width. */ 638 639 if (width != -1) { 639 cur_limited = posix_strndup(cur_borrowed, width); 640 cur_duplicated = posix_strndup(cur_borrowed, width); 641 cur_limited = cur_duplicated; 640 642 } else { 641 643 cur_limited = cur_borrowed; 642 644 } 643 cur_updated = (char *)cur_limited;645 cur_updated = cur_limited; 644 646 645 647 long long sres = 0; … … 648 650 /* Try to convert the integer. */ 649 651 if (int_conv_unsigned) { 650 ures = strtoull(cur_limited, &cur_updated, int_conv_base);652 ures = strtoull(cur_limited, (char **) &cur_updated, int_conv_base); 651 653 } else { 652 sres = strtoll(cur_limited, &cur_updated, int_conv_base);654 sres = strtoll(cur_limited, (char **) &cur_updated, int_conv_base); 653 655 } 654 656 655 657 /* Update the cursor so it can be returned to the provider. */ 656 658 cur_borrowed += cur_updated - cur_limited; 657 if ( width != -1 && cur_limited != NULL) {659 if (cur_duplicated != NULL) { 658 660 /* Deallocate duplicated part of the cursor view. */ 659 free(cur_ limited);661 free(cur_duplicated); 660 662 } 661 663 cur_limited = NULL; 662 664 cur_updated = NULL; 665 cur_duplicated = NULL; 663 666 /* Return the cursor to the provider. Input consistency is again 664 667 * the job of the provider, so we can report errors from … … 797 800 const char *cur_borrowed = NULL; 798 801 const char *cur_limited = NULL; 799 char *cur_updated = NULL; 802 char *cur_duplicated = NULL; 803 const char *cur_updated = NULL; 800 804 801 805 /* Borrow the cursor. Until it is returned to the provider … … 808 812 * than allowed by width. */ 809 813 if (width != -1) { 810 cur_limited = posix_strndup(cur_borrowed, width); 814 cur_duplicated = posix_strndup(cur_borrowed, width); 815 cur_limited = cur_duplicated; 811 816 } else { 812 817 cur_limited = cur_borrowed; 813 818 } 814 cur_updated = (char *)cur_limited;819 cur_updated = cur_limited; 815 820 816 821 float fres = 0.0; … … 821 826 switch (length_mod) { 822 827 case LMOD_NONE: 823 fres = posix_strtof(cur_limited, &cur_updated);828 fres = posix_strtof(cur_limited, (char **) &cur_updated); 824 829 break; 825 830 case LMOD_l: 826 dres = posix_strtod(cur_limited, &cur_updated);831 dres = posix_strtod(cur_limited, (char **) &cur_updated); 827 832 break; 828 833 case LMOD_L: 829 ldres = posix_strtold(cur_limited, &cur_updated);834 ldres = posix_strtold(cur_limited, (char **) &cur_updated); 830 835 break; 831 836 default: … … 835 840 /* Update the cursor so it can be returned to the provider. */ 836 841 cur_borrowed += cur_updated - cur_limited; 837 if ( width != -1 && cur_limited != NULL) {842 if (cur_duplicated != NULL) { 838 843 /* Deallocate duplicated part of the cursor view. */ 839 free(cur_ limited);844 free(cur_duplicated); 840 845 } 841 846 cur_limited = NULL; -
uspace/lib/usbdev/include/usb/dev/alternate_ifaces.h
rd39c46e0 r33b8d024 59 59 typedef struct { 60 60 /** Array of alternate interfaces descriptions. */ 61 constusb_alternate_interface_descriptors_t *alternatives;61 usb_alternate_interface_descriptors_t *alternatives; 62 62 /** Size of @c alternatives array. */ 63 63 size_t alternative_count; -
uspace/lib/usbdev/include/usb/dev/device.h
rd39c46e0 r33b8d024 51 51 usb_standard_device_descriptor_t device; 52 52 /** Full configuration descriptor of current configuration. */ 53 constvoid *full_config;53 void *full_config; 54 54 size_t full_config_size; 55 55 } usb_device_descriptors_t; -
uspace/lib/usbdev/include/usb/dev/request.h
rd39c46e0 r33b8d024 70 70 void *, size_t, size_t *); 71 71 errno_t usb_request_get_full_configuration_descriptor_alloc(usb_pipe_t *, 72 int, constvoid **, size_t *);72 int, void **, size_t *); 73 73 errno_t usb_request_set_descriptor(usb_pipe_t *, usb_request_type_t, 74 74 usb_request_recipient_t, uint8_t, uint8_t, uint16_t, const void *, size_t); -
uspace/lib/usbdev/src/devpoll.c
rd39c46e0 r33b8d024 80 80 { 81 81 assert(arg); 82 constpolling_data_t *data = arg;82 polling_data_t *data = arg; 83 83 /* Helper to reduce typing. */ 84 84 const usb_device_auto_polling_t *params = &data->auto_polling; -
uspace/lib/usbdev/src/recognise.c
rd39c46e0 r33b8d024 61 61 */ 62 62 static errno_t usb_add_match_id(match_id_list_t *matches, int score, 63 c onst char *match_str)63 char *match_str) 64 64 { 65 65 assert(matches); -
uspace/lib/usbdev/src/request.c
rd39c46e0 r33b8d024 475 475 errno_t usb_request_get_full_configuration_descriptor_alloc( 476 476 usb_pipe_t *pipe, int index, 477 constvoid **descriptor_ptr, size_t *descriptor_size)477 void **descriptor_ptr, size_t *descriptor_size) 478 478 { 479 479 errno_t rc; -
uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h
rd39c46e0 r33b8d024 105 105 void *arg 106 106 ); 107 void usb_transfer_batch_destroy( constusb_transfer_batch_t *instance);107 void usb_transfer_batch_destroy(usb_transfer_batch_t *instance); 108 108 109 109 void usb_transfer_batch_finish_error(const usb_transfer_batch_t *instance, -
uspace/lib/usbhost/src/usb_transfer_batch.c
rd39c46e0 r33b8d024 94 94 * @param[in] instance Batch structure to use. 95 95 */ 96 void usb_transfer_batch_destroy( constusb_transfer_batch_t *instance)96 void usb_transfer_batch_destroy(usb_transfer_batch_t *instance) 97 97 { 98 98 if (!instance) -
uspace/lib/usbvirt/include/usbvirt/device.h
rd39c46e0 r33b8d024 154 154 usb_standard_configuration_descriptor_t *descriptor; 155 155 /** Array of extra data. */ 156 constusbvirt_device_configuration_extras_t *extra;156 usbvirt_device_configuration_extras_t *extra; 157 157 /** Length of @c extra array. */ 158 158 size_t extra_count; -
uspace/srv/audio/hound/audio_data.c
rd39c46e0 r33b8d024 36 36 #include <macros.h> 37 37 #include <stdlib.h> 38 #include <str.h> 38 39 39 40 #include "audio_data.h" … … 50 51 pcm_format_t format) 51 52 { 52 audio_data_t *adata = malloc(sizeof(audio_data_t) );53 audio_data_t *adata = malloc(sizeof(audio_data_t) + size); 53 54 if (adata) { 54 55 unsigned overflow = size % pcm_format_frame_size(&format); … … 56 57 log_warning("Data not a multiple of frame size, " 57 58 "clipping."); 58 59 adata->data = data;59 uint8_t *d = ((uint8_t *)adata) + offsetof(audio_data_t, data); 60 memcpy(d, data, size); 60 61 adata->size = size - overflow; 61 62 adata->format = format; … … 86 87 atomic_count_t refc = atomic_predec(&adata->refcount); 87 88 if (refc == 0) { 88 free(adata->data);89 89 free(adata); 90 90 } -
uspace/srv/audio/hound/audio_data.h
rd39c46e0 r33b8d024 45 45 /** Reference counted audio buffer */ 46 46 typedef struct { 47 /** Audio data */48 const void *data;49 47 /** Size of the buffer pointer to by data */ 50 48 size_t size; … … 53 51 /** Reference counter */ 54 52 atomic_t refcount; 53 /** Audio data */ 54 const uint8_t data[]; 55 55 } audio_data_t; 56 56 -
uspace/srv/audio/hound/audio_sink.h
rd39c46e0 r33b8d024 54 54 list_t connections; 55 55 /** Sink's name */ 56 c onst char *name;56 char *name; 57 57 /** Consumes data in this format */ 58 58 pcm_format_t format; -
uspace/srv/audio/hound/audio_source.c
rd39c46e0 r33b8d024 96 96 * @return Error code. 97 97 */ 98 errno_t audio_source_push_data(audio_source_t *source, constvoid *data,98 errno_t audio_source_push_data(audio_source_t *source, void *data, 99 99 size_t size) 100 100 { -
uspace/srv/audio/hound/audio_source.h
rd39c46e0 r33b8d024 49 49 list_t connections; 50 50 /** String identifier */ 51 c onst char *name;51 char *name; 52 52 /** audio data format */ 53 53 pcm_format_t format; … … 75 75 const pcm_format_t *f); 76 76 void audio_source_fini(audio_source_t *source); 77 errno_t audio_source_push_data(audio_source_t *source, constvoid *data,77 errno_t audio_source_push_data(audio_source_t *source, void *data, 78 78 size_t size); 79 79 static inline const pcm_format_t *audio_source_format(const audio_source_t *s) -
uspace/srv/audio/hound/hound.c
rd39c46e0 r33b8d024 414 414 * @return Error code. 415 415 */ 416 errno_t hound_list_sources(hound_t *hound, c onst char ***list, size_t *size)416 errno_t hound_list_sources(hound_t *hound, char ***list, size_t *size) 417 417 { 418 418 assert(hound); … … 428 428 return EOK; 429 429 } 430 c onst char **names = calloc(count, sizeof(char *));430 char **names = calloc(count, sizeof(char *)); 431 431 errno_t ret = names ? EOK : ENOMEM; 432 432 for (unsigned long i = 0; i < count && ret == EOK; ++i) { … … 456 456 * @return Error code. 457 457 */ 458 errno_t hound_list_sinks(hound_t *hound, c onst char ***list, size_t *size)458 errno_t hound_list_sinks(hound_t *hound, char ***list, size_t *size) 459 459 { 460 460 assert(hound); … … 470 470 return EOK; 471 471 } 472 c onst char **names = calloc(count, sizeof(char *));472 char **names = calloc(count, sizeof(char *)); 473 473 errno_t ret = names ? EOK : ENOMEM; 474 474 for (size_t i = 0; i < count && ret == EOK; ++i) { -
uspace/srv/audio/hound/hound.h
rd39c46e0 r33b8d024 73 73 errno_t hound_add_source(hound_t *hound, audio_source_t *source); 74 74 errno_t hound_add_sink(hound_t *hound, audio_sink_t *sink); 75 errno_t hound_list_sources(hound_t *hound, c onst char ***list, size_t *size);76 errno_t hound_list_sinks(hound_t *hound, c onst char ***list, size_t *size);75 errno_t hound_list_sources(hound_t *hound, char ***list, size_t *size); 76 errno_t hound_list_sinks(hound_t *hound, char ***list, size_t *size); 77 77 errno_t hound_list_connections(hound_t *hound, const char ***sources, 78 78 const char ***sinks, size_t *size); -
uspace/srv/audio/hound/iface.c
rd39c46e0 r33b8d024 86 86 } 87 87 88 static errno_t iface_get_list(void *server, c onst char ***list, size_t *size,88 static errno_t iface_get_list(void *server, char ***list, size_t *size, 89 89 const char *connection, int flags) 90 90 { -
uspace/srv/devman/devman.h
rd39c46e0 r33b8d024 80 80 char *name; 81 81 /** Path to the driver's binary. */ 82 c onst char *binary_path;82 char *binary_path; 83 83 /** List of device ids for device-to-driver matching. */ 84 84 match_id_list_t match_ids;
Note:
See TracChangeset
for help on using the changeset viewer.