Convert non-mandatory attributes to macros

They're shorter and more portable.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2018-12-19 20:50:02 +00:00
parent 5f57cb41f9
commit e58cbf8add
11 changed files with 38 additions and 37 deletions

View File

@ -2,18 +2,19 @@
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
#pragma once
#include "compiler.h"
/// Code for generating convolution kernels
typedef struct conv {
int size;
double data[];
int size;
double data[];
} conv;
/// Calculate the sum of a rectangle part of the convolution kernel
/// the rectangle is defined by top left (x, y), and a size (width x height)
double
sum_kernel(conv *map, int x, int y, int width, int height);
double attr_const attr_pure sum_kernel(const conv *map, int x, int y, int width,
int height);
/// Create a kernel with gaussian distribution of radius r
conv *gaussian_kernel(double r);