diff options
author | Ryan Kavanagh <rak@rak.ac> | 2021-12-13 16:55:42 -0500 |
---|---|---|
committer | Ryan Kavanagh <rak@rak.ac> | 2021-12-13 16:58:10 -0500 |
commit | e5dfb045b994e1ab8fef9ef5d3f02ce20ea6b685 (patch) | |
tree | ba74287d80e46c70dab8c4311a1dc933fbfbdea1 /.vim/c-support/codesnippets/calloc_int_matrix.c | |
parent | fix pager again (diff) |
many more renames
Diffstat (limited to '.vim/c-support/codesnippets/calloc_int_matrix.c')
-rw-r--r-- | .vim/c-support/codesnippets/calloc_int_matrix.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/.vim/c-support/codesnippets/calloc_int_matrix.c b/.vim/c-support/codesnippets/calloc_int_matrix.c deleted file mode 100644 index e21215b..0000000 --- a/.vim/c-support/codesnippets/calloc_int_matrix.c +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * === FUNCTION ====================================================================== - * Name: calloc_int_matrix - * Description: Allocate a dynamic int-matrix of size rows*columns; return a pointer. - * ===================================================================================== - */ -int** -calloc_int_matrix ( int rows, int columns ) -{ - int i; - int **m; - m = calloc ( rows, sizeof(int*) ); /* allocate pointer array */ - assert( m != NULL ); /* abort if allocation failed */ - *m = calloc ( rows*columns, sizeof(int) ); /* allocate data array */ - assert(*m != NULL ); /* abort if allocation failed */ - for ( i=1; i<rows; i+=1 ) /* set pointers */ - m[i] = m[i-1] + columns; - return m; -} /* ---------- end of function calloc_int_matrix ---------- */ - -/* - * === FUNCTION ====================================================================== - * Name: free_int_matrix - * Description: Free a dynamic int-matrix. - * ===================================================================================== - */ -void -free_int_matrix ( int **m ) -{ - free(*m); /* free data array */ - free( m); /* free pointer array */ - return ; -} /* ---------- end of function free_int_matrix ---------- */ - |