Skip to content
Snippets Groups Projects
Closed (moved) Decrease casting in rendcache functions
  • View options
  • Decrease casting in rendcache functions

  • View options
  • Closed (moved) Issue created by cypherpunks

    During work on #17776 (moved) i have identified three functions which could, with a type signature change, save some casting throughout the Tor code base. These functions are

    void rend_cache_intro_failure_note(rend_intro_point_failure_t failure,
                                       const uint8_t *identity,
                                       const char *service_id);
    STATIC int cache_failure_intro_lookup(const uint8_t *identity,
                                          const char *service_id,
                                          rend_cache_failure_intro_t
                                          **intro_entry);
    STATIC void cache_failure_intro_add(const uint8_t *identity,
                                        const char *service_id,
                                        rend_intro_point_failure_t failure);

    The identity pointers to uint8_t are internally cast to pointers to char for further processing. Meanwhile the callers of these functions cast the identity pointer from pointer to char to pointer to uint8_t to conform to its type signature.

    Changing the type of the identity pointer from uint8_t to char would remove the need for casting back and forth.

    Linked items ... 0

  • Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first
    Loading Loading Loading Loading Loading Loading Loading Loading Loading Loading