~ubuntu-branches/debian/sid/neovim/sid

« back to all changes in this revision

Viewing changes to src/nvim/map.c

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2016-04-18 21:42:19 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20160418214219-1e6d4o1fwqarzk46
Tags: 0.1.3-1
* New upstream release.  (Closes: #820562)
* debian/control:
  + Remove unnecessary luarocks Build-Depends
  + Add libkvm-dev Build-Depends for kfreebsd-*
  + Add python(3)-neovim to Recommends.  (Closes: #812737)
  + Declare compiance with policy 3.9.8, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#define uint32_t_eq kh_int_hash_equal
19
19
#define int_hash kh_int_hash_func
20
20
#define int_eq kh_int_hash_equal
 
21
#define linenr_T_hash kh_int_hash_func
 
22
#define linenr_T_eq kh_int_hash_equal
 
23
 
21
24
 
22
25
#if defined(ARCH_64)
23
26
#define ptr_t_hash(key) uint64_t_hash((uint64_t)key)
78
81
    return rv;                                                                \
79
82
  }                                                                           \
80
83
                                                                              \
 
84
  U *map_##T##_##U##_ref(Map(T, U) *map, T key, bool put)                     \
 
85
  {                                                                           \
 
86
    int ret;                                                                  \
 
87
    khiter_t k;                                                               \
 
88
    if (put) {                                                                \
 
89
      k = kh_put(T##_##U##_map, map->table, key, &ret);                       \
 
90
      if (ret) {                                                              \
 
91
        kh_val(map->table, k) = INITIALIZER(T, U);                            \
 
92
      }                                                                       \
 
93
    } else {                                                                  \
 
94
      k = kh_get(T##_##U##_map, map->table, key);                             \
 
95
      if (k == kh_end(map->table)) {                                          \
 
96
        return NULL;                                                          \
 
97
      }                                                                       \
 
98
    }                                                                         \
 
99
                                                                              \
 
100
    return &kh_val(map->table, k);                                            \
 
101
  }                                                                           \
 
102
                                                                              \
81
103
  U map_##T##_##U##_del(Map(T, U) *map, T key)                                \
82
104
  {                                                                           \
83
105
    U rv = INITIALIZER(T, U);                                                 \
118
140
MAP_IMPL(uint64_t, ptr_t, DEFAULT_INITIALIZER)
119
141
#define MSGPACK_HANDLER_INITIALIZER {.fn = NULL, .async = false}
120
142
MAP_IMPL(String, MsgpackRpcRequestHandler, MSGPACK_HANDLER_INITIALIZER)
 
143
#define KVEC_INITIALIZER { .size = 0, .capacity = 0, .items = NULL }
 
144
MAP_IMPL(linenr_T, bufhl_vec_T, KVEC_INITIALIZER)