News for hackers. Stuff that matters.
Re:15-line hash table in C by viraptor on Thursday December 11, 2014 @11:53PM (#8738619)
Is this some common style?

    int (**hnew())
I've never seen parens used like that. Usually it's:

    int **hnew()
Re:15-line hash table in C by userbinator on Friday December 12, 2014 @12:53AM (#8738765)
[] has higher precedence than *, so without the parens you get "function returning array of two pointer to pointer to int" (which is illegal) instead of the desired "function returning pointer to pointer to array of two int".
Re:15-line hash table in C by pmelendez on Friday December 12, 2014 @11:25AM (#8740923)
So would that be equal to this?

    typedef int arr2int[2];
    typedef arr2int** ptr_arr2int;

    #define SIZE 1024
    static ptr_arr2int hnew() {
        return calloc(sizeof(int**), SIZE);
    }
Re:15-line hash table in C by art187 on Thursday December 11, 2014 @11:59PM (#8738633)
parens are used since the [2] is on the end. Otherwise, it would think its a pointer to a pointer of an int [2] -> (hnew()[2]).
Re:15-line hash table in C by DiabloD3 on Thursday December 11, 2014 @11:56PM (#8738624)
Might be to fix some -pedantic issue.
Re:15-line hash table in C by valleyer on Friday December 12, 2014 @12:26AM (#8738696)
No, they are necessary here, otherwise it would return two pointers to pointers to int, not a pointer to pointer to int[2]