Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Trac Trac
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Service Desk
    • Milestones
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
  • Wiki
    • Wiki
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • Legacy
  • TracTrac
  • Issues
  • #17794

Closed (moved)
(moved)
Open
Created Dec 09, 2015 by cypherpunks@cypherpunks

Decrease casting in rendcache functions

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.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking