Abstract the working data type to its own header

This commit is contained in:
Miguel M 2023-04-29 18:24:37 +01:00
parent a614b03229
commit da3327ce7e
2 changed files with 14 additions and 6 deletions

12
includes/data.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef ACED_INCLUDES_DATA_H
#define ACED_INCLUDES_DATA_H
// Definition of the datatype representing the input.
#include <inttypes.h>
#define PRImDATA PRIiFAST32
#define SCNmDATA SCNiFAST32
typedef int_fast32_t data_t;
#endif

View File

@ -2,11 +2,7 @@
#define ACED_INCLUDES_MATRIX_H_
#include <stddef.h>
#include <inttypes.h>
#define PRImDATA PRIiFAST32
#define SCNmDATA SCNiFAST32
typedef int_fast32_t matrix_data_t;
#include "../includes/data.h"
// Struct representing the input matrix.
typedef struct
@ -14,7 +10,7 @@ typedef struct
// Number of elements in one row.
size_t row_len;
// Pointer to the buffer containing the matrix's entries.
matrix_data_t *head;
data_t *head;
// Number of entries in the matrix.
size_t len;
} matrix_t;