Changeset 61eb2ce2 in mainline for uspace/srv


Ignore:
Timestamp:
2023-02-05T22:03:19Z (3 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b596d0d
Parents:
07700ed
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-05 22:01:46)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-05 22:03:19)
Message:

Make hash table operations immutable, because global mutable state is evil

Location:
uspace/srv
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devtree.c

    r07700ed r61eb2ce2  
    9393}
    9494
    95 static hash_table_ops_t devman_devices_ops = {
     95static const hash_table_ops_t devman_devices_ops = {
    9696        .hash = devman_devices_hash,
    9797        .key_hash = handle_key_hash,
     
    101101};
    102102
    103 static hash_table_ops_t devman_functions_ops = {
     103static const hash_table_ops_t devman_functions_ops = {
    104104        .hash = devman_functions_hash,
    105105        .key_hash = handle_key_hash,
     
    109109};
    110110
    111 static hash_table_ops_t loc_devices_ops = {
     111static const hash_table_ops_t loc_devices_ops = {
    112112        .hash = loc_functions_hash,
    113113        .key_hash = service_id_key_hash,
  • uspace/srv/fs/cdfs/cdfs_ops.c

    r07700ed r61eb2ce2  
    323323
    324324/** Nodes hash table operations */
    325 static hash_table_ops_t nodes_ops = {
     325static const hash_table_ops_t nodes_ops = {
    326326        .hash = nodes_hash,
    327327        .key_hash = nodes_key_hash,
  • uspace/srv/fs/exfat/exfat_idx.c

    r07700ed r61eb2ce2  
    149149}
    150150
    151 static hash_table_ops_t uph_ops = {
     151static const hash_table_ops_t uph_ops = {
    152152        .hash = pos_hash,
    153153        .key_hash = pos_key_hash,
     
    195195}
    196196
    197 static hash_table_ops_t uih_ops = {
     197static const hash_table_ops_t uih_ops = {
    198198        .hash = idx_hash,
    199199        .key_hash = idx_key_hash,
  • uspace/srv/fs/fat/fat_idx.c

    r07700ed r61eb2ce2  
    149149}
    150150
    151 static hash_table_ops_t uph_ops = {
     151static const hash_table_ops_t uph_ops = {
    152152        .hash = pos_hash,
    153153        .key_hash = pos_key_hash,
     
    195195}
    196196
    197 static hash_table_ops_t uih_ops = {
     197static const hash_table_ops_t uih_ops = {
    198198        .hash = idx_hash,
    199199        .key_hash = idx_key_hash,
  • uspace/srv/fs/locfs/locfs_ops.c

    r07700ed r61eb2ce2  
    9595}
    9696
    97 static hash_table_ops_t services_ops = {
     97static const hash_table_ops_t services_ops = {
    9898        .hash = services_hash,
    9999        .key_hash = services_key_hash,
  • uspace/srv/fs/mfs/mfs_ops.c

    r07700ed r61eb2ce2  
    123123}
    124124
    125 static hash_table_ops_t open_nodes_ops = {
     125static const hash_table_ops_t open_nodes_ops = {
    126126        .hash = open_nodes_hash,
    127127        .key_hash = open_nodes_key_hash,
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    r07700ed r61eb2ce2  
    189189
    190190/** TMPFS nodes hash table operations. */
    191 hash_table_ops_t nodes_ops = {
     191const hash_table_ops_t nodes_ops = {
    192192        .hash = nodes_hash,
    193193        .key_hash = nodes_key_hash,
  • uspace/srv/fs/udf/udf_idx.c

    r07700ed r61eb2ce2  
    7878}
    7979
    80 static hash_table_ops_t udf_idx_ops = {
     80static const hash_table_ops_t udf_idx_ops = {
    8181        .hash = udf_idx_hash,
    8282        .key_hash = udf_idx_key_hash,
  • uspace/srv/hid/input/gsp.c

    r07700ed r61eb2ce2  
    8484}
    8585
    86 static hash_table_ops_t trans_ops = {
     86static const hash_table_ops_t trans_ops = {
    8787        .hash = trans_hash,
    8888        .key_hash = trans_key_hash,
  • uspace/srv/ns/service.c

    r07700ed r61eb2ce2  
    112112
    113113/** Operations for service hash table. */
    114 static hash_table_ops_t service_hash_table_ops = {
     114static const hash_table_ops_t service_hash_table_ops = {
    115115        .hash = service_hash,
    116116        .key_hash = service_key_hash,
     
    121121
    122122/** Operations for interface hash table. */
    123 static hash_table_ops_t iface_hash_table_ops = {
     123static const hash_table_ops_t iface_hash_table_ops = {
    124124        .hash = iface_hash,
    125125        .key_hash = iface_key_hash,
  • uspace/srv/ns/task.c

    r07700ed r61eb2ce2  
    8080
    8181/** Operations for task hash table. */
    82 static hash_table_ops_t task_hash_table_ops = {
     82static const hash_table_ops_t task_hash_table_ops = {
    8383        .hash = task_hash,
    8484        .key_hash = task_key_hash,
     
    131131
    132132/** Operations for task hash table. */
    133 static hash_table_ops_t p2i_ops = {
     133static const hash_table_ops_t p2i_ops = {
    134134        .hash = p2i_hash,
    135135        .key_hash = p2i_key_hash,
  • uspace/srv/vfs/vfs_node.c

    r07700ed r61eb2ce2  
    6666
    6767/** VFS node hash table operations. */
    68 hash_table_ops_t nodes_ops = {
     68const hash_table_ops_t nodes_ops = {
    6969        .hash = nodes_hash,
    7070        .key_hash = nodes_key_hash,
Note: See TracChangeset for help on using the changeset viewer.