dev: norm
This commit is contained in:
parent
1c023df1ff
commit
a93af5c48f
4 changed files with 26 additions and 23 deletions
10
dev/norm.sh
10
dev/norm.sh
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Use the norminette but without all these rules that make coding harder.
|
||||
|
||||
norminette | grep -v \
|
||||
norminette $* | grep -v \
|
||||
"INVALID_HEADER
|
||||
VAR_DECL_START_FUNC
|
||||
EMPTY_LINE_FUNCTION
|
||||
|
@ -10,10 +10,10 @@ TOO_MANY_ARGS
|
|||
TOO_MANY_FUNCS
|
||||
TOO_MANY_LINES
|
||||
PREPROC_CONSTANT
|
||||
MACRO_FUNC_FORBIDDEN
|
||||
GLOBAL_VAR_DETECTED
|
||||
WRONG_SCOPE_COMMENT
|
||||
MULT_DECL_LINE
|
||||
GOTO_FBIDDEN
|
||||
LABEL_FBIDDEN
|
||||
TERNARY_FBIDDEN"
|
||||
FORBIDDEN
|
||||
FBIDDEN
|
||||
SPACE_EMPTY_LINE
|
||||
DECL_ASSIGN_LINE"
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
* with embedassets.sh.
|
||||
*/
|
||||
|
||||
#ifndef MLX3DS_ASSETS_H
|
||||
# define MLX3DS_ASSETS_H
|
||||
#ifndef MLX3DS_EMBEDDEDASSETS_H
|
||||
# define MLX3DS_EMBEDDEDASSETS_H
|
||||
|
||||
# include <string.h>
|
||||
|
||||
|
|
|
@ -21,22 +21,24 @@ typedef struct s_in_assetsocket
|
|||
// This function is implemented in embedassets.sh
|
||||
const t_embeddedasset *mlx3ds_assets_get(const char *name);
|
||||
|
||||
t_assetsocket mlx3ds_assets_open(const char *name) {
|
||||
t_assetsocket mlx3ds_assets_open(const char *name)
|
||||
{
|
||||
const t_embeddedasset *asset;
|
||||
t_in_assetsocket *r;
|
||||
|
||||
asset = mlx3ds_assets_get(name);
|
||||
if (!asset)
|
||||
return NULL;
|
||||
return (NULL);
|
||||
r = malloc(sizeof(t_in_assetsocket));
|
||||
if (!r)
|
||||
return NULL;
|
||||
return (NULL);
|
||||
r->asset = asset;
|
||||
r->i = 0;
|
||||
return r;
|
||||
return (r);
|
||||
}
|
||||
|
||||
size_t mlx3ds_assets_read(t_assetsocket asset, void *buf, size_t count) {
|
||||
size_t mlx3ds_assets_read(t_assetsocket asset, void *buf, size_t count)
|
||||
{
|
||||
t_in_assetsocket *asset_ = asset;
|
||||
|
||||
if (count > asset_->asset->size - asset_->i)
|
||||
|
@ -44,9 +46,10 @@ size_t mlx3ds_assets_read(t_assetsocket asset, void *buf, size_t count) {
|
|||
|
||||
memcpy(buf, asset_->asset->data + asset_->i, count);
|
||||
asset_->i += count;
|
||||
return count;
|
||||
return (count);
|
||||
}
|
||||
|
||||
void mlx3ds_assets_close(t_assetsocket asset) {
|
||||
void mlx3ds_assets_close(t_assetsocket asset)
|
||||
{
|
||||
free(asset);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue