mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Move the compile_commands database into build dir
This commit is contained in:
parent
0ec5ae02e9
commit
a92149c5b8
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,8 +6,6 @@
|
||||
.bzrignore
|
||||
.build-cache
|
||||
.cache
|
||||
/compile_commands.json
|
||||
/link_commands.json
|
||||
/src/calibre/plugins
|
||||
/resources/images.qrc
|
||||
/resources/icons.rcc
|
||||
|
@ -301,7 +301,7 @@ class Build(Command):
|
||||
|
||||
def dump_db(self, name, db):
|
||||
try:
|
||||
with open(f'{name}_commands.json', 'w') as f:
|
||||
with open(f'build/{name}_commands.json', 'w') as f:
|
||||
json.dump(db, f, indent=2)
|
||||
except OSError as err:
|
||||
if err.errno != errno.EROFS:
|
||||
|
@ -164,7 +164,7 @@ speedup_create_texture(PyObject *self, PyObject *args, PyObject *kw) {
|
||||
if (radius <= 0) { PyErr_SetString(PyExc_ValueError, "The radius must be positive"); return NULL; }
|
||||
if (width > 100000 || height > 10000) { PyErr_SetString(PyExc_ValueError, "The width or height is too large"); return NULL; }
|
||||
if (width < 1 || height < 1) { PyErr_SetString(PyExc_ValueError, "The width or height is too small"); return NULL; }
|
||||
snprintf(header, 99, "P6\n%d %d\n255\n", (int)width, (int)height);
|
||||
snprintf(header, sizeof(header)-1, "P6\n%d %d\n255\n", (int)width, (int)height); // NOLINT
|
||||
|
||||
kernel = (double*)calloc(weight * weight, sizeof(double));
|
||||
if (kernel == NULL) { PyErr_NoMemory(); return NULL; }
|
||||
@ -177,7 +177,7 @@ speedup_create_texture(PyObject *self, PyObject *args, PyObject *kw) {
|
||||
|
||||
// Random noise, noisy pixels are blend_alpha, other pixels are 0
|
||||
for (i = 0; i < width * height; i++) {
|
||||
if (((float)(rand()) / RAND_MAX) <= density) mask[i] = blend_alpha;
|
||||
if (((float)(rand()) / (float)RAND_MAX) <= density) mask[i] = blend_alpha;
|
||||
}
|
||||
|
||||
// Blur the noise using the gaussian kernel
|
||||
@ -195,7 +195,7 @@ speedup_create_texture(PyObject *self, PyObject *args, PyObject *kw) {
|
||||
}
|
||||
|
||||
// Create the texture in PPM (P6) format
|
||||
memcpy(ppm, header, strlen(header));
|
||||
memcpy(ppm, header, strlen(header)); // NOLINT
|
||||
t = ppm + strlen(header);
|
||||
for (i = 0, j = 0; j < width * height; i += 3, j += 1) {
|
||||
#define BLEND(src, dest) ( ((unsigned char)(src * mask[j])) + ((unsigned char)(dest * (1 - mask[j]))) )
|
||||
|
Loading…
x
Reference in New Issue
Block a user