Ignore:
Timestamp:
Apr 30, 2018, 11:59:07 AM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
7b45636
Parents:
c0453ca3 (diff), b9c432f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into fix-reference-overloading

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/general/evaluation/c-pair.c

    rc0453ca3 r1a3eab8  
    22#include "c-pair.h"
    33
    4 struct pair* new_pair(void* first, void* second) {
    5         struct pair* p = malloc(sizeof(struct pair)); /***/
    6         *p = (struct pair){ first, second }; /***/
     4pair * new_pair( void * first, void * second ) {
     5        pair * p = malloc( sizeof(pair) ); /***/
     6        *p = (pair){ first, second }; /***/
    77        return p;
    88}
    99
    10 struct pair* copy_pair(const struct pair* src,
    11                 void* (*copy_first)(const void*), void* (*copy_second)(const void*)) {
     10pair * copy_pair( const pair * src,
     11                void * (* copy_first)(const void* ), void * (* copy_second)(const void *)) {
    1212        return new_pair( copy_first(src->first), copy_second(src->second) );
    1313}
    1414
    15 void free_pair(struct pair* p, void (*free_first)(void*), void (*free_second)(void*)) {
    16         free_first(p->first);
    17         free_second(p->second);
    18         free(p);
     15void free_pair( pair * p, void (* free_first)(void *), void (* free_second)(void *)) {
     16        free_first( p->first );
     17        free_second( p->second );
     18        free( p );
    1919}
    2020
    21 int cmp_pair(const struct pair* a, const struct pair* b,
    22                 int (*cmp_first)(const void*, const void*), int (*cmp_second)(const void*, const void*)) {
    23         int c = cmp_first(a->first, b->first);
    24         if ( c == 0 ) c = cmp_second(a->second, b->second);
     21int cmp_pair( const pair * a, const pair * b,
     22                int (* cmp_first)(const void *, const void *), int (* cmp_second)(const void *, const void *)) {
     23        int c = cmp_first( a->first, b->first );
     24        if ( c == 0 ) c = cmp_second( a->second, b->second );
    2525        return c;
    2626}
Note: See TracChangeset for help on using the changeset viewer.