style cleanup
This commit is contained in:
parent
822362189b
commit
857dedbc58
9
extern/libredcode/codec.c
vendored
9
extern/libredcode/codec.c
vendored
@ -7,17 +7,20 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
static void error_callback(const char *msg, void *client_data) {
|
||||
static void error_callback(const char *msg, void *client_data)
|
||||
{
|
||||
FILE *stream = (FILE*)client_data;
|
||||
fprintf(stream, "[R3D ERR] %s", msg);
|
||||
}
|
||||
|
||||
static void warning_callback(const char *msg, void *client_data) {
|
||||
static void warning_callback(const char *msg, void *client_data)
|
||||
{
|
||||
FILE *stream = (FILE*)client_data;
|
||||
fprintf(stream, "[R3D WARN] %s", msg);
|
||||
}
|
||||
|
||||
static void info_callback(const char *msg, void *client_data) {
|
||||
static void info_callback(const char *msg, void *client_data)
|
||||
{
|
||||
(void)client_data;
|
||||
fprintf(stdout, "[R3D INFO] %s", msg);
|
||||
}
|
||||
|
@ -673,7 +673,7 @@ static void xml_read_mesh(const XMLReadState& state, pugi::xml_node node)
|
||||
for(int j = 0; j < nverts[i]-2; j++) {
|
||||
int v0 = verts[index_offset];
|
||||
int v1 = verts[index_offset + j + 1];
|
||||
int v2 = verts[index_offset + j + 2];;
|
||||
int v2 = verts[index_offset + j + 2];
|
||||
|
||||
sdmesh.add_face(v0, v1, v2);
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ static ShaderNode *add_node(BL::BlendData b_data, ShaderGraph *graph, BL::Shader
|
||||
break;
|
||||
}
|
||||
case BL::ShaderNode::type_TEX_COORD: {
|
||||
node = new TextureCoordinateNode();;
|
||||
node = new TextureCoordinateNode();
|
||||
break;
|
||||
}
|
||||
case BL::ShaderNode::type_TEX_SKY: {
|
||||
|
@ -226,7 +226,7 @@ public:
|
||||
string kernel_path = path_get("kernel");
|
||||
string md5 = path_files_md5_hash(kernel_path);
|
||||
|
||||
cubin = string_printf("cycles_kernel_sm%d%d_%s.cubin", major, minor, md5.c_str());;
|
||||
cubin = string_printf("cycles_kernel_sm%d%d_%s.cubin", major, minor, md5.c_str());
|
||||
cubin = path_user_get(path_join("cache", cubin));
|
||||
|
||||
/* if exists already, use it */
|
||||
|
@ -407,7 +407,7 @@ public:
|
||||
string device_md5 = device_md5_hash();
|
||||
|
||||
/* try to use cache binary */
|
||||
string clbin = string_printf("cycles_kernel_%s_%s.clbin", device_md5.c_str(), kernel_md5.c_str());;
|
||||
string clbin = string_printf("cycles_kernel_%s_%s.clbin", device_md5.c_str(), kernel_md5.c_str());
|
||||
clbin = path_user_get(path_join("cache", clbin));
|
||||
|
||||
if(path_exists(clbin)) {
|
||||
|
@ -43,7 +43,7 @@ __device_inline float3 svm_world_to_ndc(KernelGlobals *kg, ShaderData *sd, float
|
||||
else
|
||||
P = normalize(transform_direction(&tfm, P));
|
||||
|
||||
float2 uv = direction_to_panorama(kg, P);;
|
||||
float2 uv = direction_to_panorama(kg, P);
|
||||
|
||||
return make_float3(uv.x, uv.y, 0.0f);
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public:
|
||||
|
||||
static void *run(void *arg)
|
||||
{
|
||||
((thread*)arg)->run_cb();;
|
||||
((thread*)arg)->run_cb();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,8 @@
|
||||
#include "GHOST_C-api.h"
|
||||
#include "EventToBuf.h"
|
||||
|
||||
char *eventtype_to_string(GHOST_TEventType type) {
|
||||
char *eventtype_to_string(GHOST_TEventType type)
|
||||
{
|
||||
switch(type) {
|
||||
case GHOST_kEventCursorMove: return "CursorMove";
|
||||
case GHOST_kEventButtonDown: return "ButtonDown";
|
||||
@ -55,7 +56,8 @@ char *eventtype_to_string(GHOST_TEventType type) {
|
||||
}
|
||||
}
|
||||
|
||||
static char *keytype_to_string(GHOST_TKey key) {
|
||||
static char *keytype_to_string(GHOST_TKey key)
|
||||
{
|
||||
#define K(key) case GHOST_k##key: return #key;
|
||||
switch (key) {
|
||||
K(KeyBackSpace);
|
||||
@ -193,7 +195,8 @@ static char *keytype_to_string(GHOST_TKey key) {
|
||||
#undef K
|
||||
}
|
||||
|
||||
void event_to_buf(GHOST_EventHandle evt, char buf[128]) {
|
||||
void event_to_buf(GHOST_EventHandle evt, char buf[128])
|
||||
{
|
||||
GHOST_TEventType type= GHOST_GetEventType(evt);
|
||||
double time= (double) ((GHOST_TInt64) GHOST_GetEventTime(evt))/1000;
|
||||
GHOST_WindowHandle win= GHOST_GetEventWindow(evt);
|
||||
|
@ -75,7 +75,8 @@ void multitestapp_exit(MultiTestApp *app);
|
||||
|
||||
/**/
|
||||
|
||||
void rect_bevel_side(int rect[2][2], int side, float *lt, float *dk, float *col, int width) {
|
||||
void rect_bevel_side(int rect[2][2], int side, float *lt, float *dk, float *col, int width)
|
||||
{
|
||||
int ltidx = (side / 2) % 4;
|
||||
int dkidx = (ltidx + 1 + (side & 1)) % 4;
|
||||
int i, corner;
|
||||
@ -107,7 +108,8 @@ void rect_bevel_side(int rect[2][2], int side, float *lt, float *dk, float *col,
|
||||
glRecti(rect[0][0] + width, rect[0][1] + width, rect[1][0] - width, rect[1][1] - width);
|
||||
}
|
||||
|
||||
void rect_bevel_smooth(int rect[2][2], int width) {
|
||||
void rect_bevel_smooth(int rect[2][2], int width)
|
||||
{
|
||||
float *lt = malloc(sizeof(*lt) * width);
|
||||
float *dk = malloc(sizeof(*dk) * width);
|
||||
float col[4];
|
||||
@ -143,11 +145,13 @@ typedef struct {
|
||||
int tmouse[2];
|
||||
} MainWindow;
|
||||
|
||||
static void mainwindow_log(MainWindow *mw, char *str) {
|
||||
static void mainwindow_log(MainWindow *mw, char *str)
|
||||
{
|
||||
loggerwindow_log(multitestapp_get_logger(mw->app), str);
|
||||
}
|
||||
|
||||
static void mainwindow_do_draw(MainWindow *mw) {
|
||||
static void mainwindow_do_draw(MainWindow *mw)
|
||||
{
|
||||
GHOST_ActivateWindowDrawingContext(mw->win);
|
||||
|
||||
if (mw->lmbut[0]) {
|
||||
@ -164,7 +168,8 @@ static void mainwindow_do_draw(MainWindow *mw) {
|
||||
GHOST_SwapWindowBuffers(mw->win);
|
||||
}
|
||||
|
||||
static void mainwindow_do_reshape(MainWindow *mw) {
|
||||
static void mainwindow_do_reshape(MainWindow *mw)
|
||||
{
|
||||
GHOST_RectangleHandle bounds = GHOST_GetClientBounds(mw->win);
|
||||
|
||||
GHOST_ActivateWindowDrawingContext(mw->win);
|
||||
@ -183,7 +188,8 @@ static void mainwindow_do_reshape(MainWindow *mw) {
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
static void mainwindow_do_key(MainWindow *mw, GHOST_TKey key, int press) {
|
||||
static void mainwindow_do_key(MainWindow *mw, GHOST_TKey key, int press)
|
||||
{
|
||||
switch (key) {
|
||||
case GHOST_kKeyC:
|
||||
if (press)
|
||||
@ -226,7 +232,8 @@ static void mainwindow_do_key(MainWindow *mw, GHOST_TKey key, int press) {
|
||||
}
|
||||
}
|
||||
|
||||
static void mainwindow_do_move(MainWindow *mw, int x, int y) {
|
||||
static void mainwindow_do_move(MainWindow *mw, int x, int y)
|
||||
{
|
||||
mw->lmouse[0] = x, mw->lmouse[1] = y;
|
||||
|
||||
if (mw->lmbut[0]) {
|
||||
@ -235,7 +242,8 @@ static void mainwindow_do_move(MainWindow *mw, int x, int y) {
|
||||
}
|
||||
}
|
||||
|
||||
static void mainwindow_do_button(MainWindow *mw, int which, int press) {
|
||||
static void mainwindow_do_button(MainWindow *mw, int which, int press)
|
||||
{
|
||||
if (which == GHOST_kButtonMaskLeft) {
|
||||
mw->lmbut[0] = press;
|
||||
mw->tmouse[0] = mw->lmouse[0], mw->tmouse[1] = mw->lmouse[1];
|
||||
@ -249,7 +257,8 @@ static void mainwindow_do_button(MainWindow *mw, int which, int press) {
|
||||
}
|
||||
}
|
||||
|
||||
static void mainwindow_handle(void *priv, GHOST_EventHandle evt) {
|
||||
static void mainwindow_handle(void *priv, GHOST_EventHandle evt)
|
||||
{
|
||||
MainWindow *mw = priv;
|
||||
GHOST_TEventType type = GHOST_GetEventType(evt);
|
||||
char buf[256];
|
||||
@ -289,7 +298,8 @@ static void mainwindow_handle(void *priv, GHOST_EventHandle evt) {
|
||||
|
||||
/**/
|
||||
|
||||
static void mainwindow_timer_proc(GHOST_TimerTaskHandle task, GHOST_TUns64 time) {
|
||||
static void mainwindow_timer_proc(GHOST_TimerTaskHandle task, GHOST_TUns64 time)
|
||||
{
|
||||
MainWindow *mw = GHOST_GetTimerTaskUserData(task);
|
||||
char buf[64];
|
||||
|
||||
@ -321,7 +331,8 @@ MainWindow *mainwindow_new(MultiTestApp *app) {
|
||||
}
|
||||
}
|
||||
|
||||
void mainwindow_free(MainWindow *mw) {
|
||||
void mainwindow_free(MainWindow *mw)
|
||||
{
|
||||
GHOST_SystemHandle sys = multitestapp_get_system(mw->app);
|
||||
|
||||
windowdata_free(GHOST_GetWindowUserData(mw->win));
|
||||
@ -362,7 +373,8 @@ struct _LoggerWindow {
|
||||
#define SCROLLBAR_PAD 2
|
||||
#define SCROLLBAR_WIDTH 14
|
||||
#define TEXTAREA_PAD 2
|
||||
static void loggerwindow_recalc_regions(LoggerWindow *lw) {
|
||||
static void loggerwindow_recalc_regions(LoggerWindow *lw)
|
||||
{
|
||||
int nscroll[2][2];
|
||||
|
||||
nscroll[0][0] = SCROLLBAR_PAD;
|
||||
@ -381,7 +393,8 @@ static void loggerwindow_recalc_regions(LoggerWindow *lw) {
|
||||
scrollbar_set_rect(lw->scroll, nscroll);
|
||||
}
|
||||
|
||||
static void loggerwindow_setup_window_gl(LoggerWindow *lw) {
|
||||
static void loggerwindow_setup_window_gl(LoggerWindow *lw)
|
||||
{
|
||||
glViewport(0, 0, lw->size[0], lw->size[1]);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
@ -393,7 +406,8 @@ static void loggerwindow_setup_window_gl(LoggerWindow *lw) {
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
static void loggerwindow_do_reshape(LoggerWindow *lw) {
|
||||
static void loggerwindow_do_reshape(LoggerWindow *lw)
|
||||
{
|
||||
GHOST_RectangleHandle bounds = GHOST_GetClientBounds(lw->win);
|
||||
|
||||
GHOST_ActivateWindowDrawingContext(lw->win);
|
||||
@ -405,7 +419,8 @@ static void loggerwindow_do_reshape(LoggerWindow *lw) {
|
||||
loggerwindow_setup_window_gl(lw);
|
||||
}
|
||||
|
||||
static void loggerwindow_do_draw(LoggerWindow *lw) {
|
||||
static void loggerwindow_do_draw(LoggerWindow *lw)
|
||||
{
|
||||
int i, ndisplines, startline;
|
||||
int sb_rect[2][2], sb_thumb[2][2];
|
||||
|
||||
@ -472,7 +487,8 @@ static void loggerwindow_do_draw(LoggerWindow *lw) {
|
||||
GHOST_SwapWindowBuffers(lw->win);
|
||||
}
|
||||
|
||||
static void loggerwindow_do_move(LoggerWindow *lw, int x, int y) {
|
||||
static void loggerwindow_do_move(LoggerWindow *lw, int x, int y)
|
||||
{
|
||||
lw->lmouse[0] = x, lw->lmouse[1] = y;
|
||||
|
||||
if (scrollbar_is_scrolling(lw->scroll)) {
|
||||
@ -481,7 +497,8 @@ static void loggerwindow_do_move(LoggerWindow *lw, int x, int y) {
|
||||
}
|
||||
}
|
||||
|
||||
static void loggerwindow_do_button(LoggerWindow *lw, int which, int press) {
|
||||
static void loggerwindow_do_button(LoggerWindow *lw, int which, int press)
|
||||
{
|
||||
if (which == GHOST_kButtonMaskLeft) {
|
||||
lw->lmbut[0] = press;
|
||||
|
||||
@ -508,7 +525,8 @@ static void loggerwindow_do_button(LoggerWindow *lw, int which, int press) {
|
||||
}
|
||||
}
|
||||
|
||||
static void loggerwindow_do_key(LoggerWindow *lw, GHOST_TKey key, int press) {
|
||||
static void loggerwindow_do_key(LoggerWindow *lw, GHOST_TKey key, int press)
|
||||
{
|
||||
switch (key) {
|
||||
case GHOST_kKeyQ:
|
||||
if (press)
|
||||
@ -517,7 +535,8 @@ static void loggerwindow_do_key(LoggerWindow *lw, GHOST_TKey key, int press) {
|
||||
}
|
||||
}
|
||||
|
||||
static void loggerwindow_handle(void *priv, GHOST_EventHandle evt) {
|
||||
static void loggerwindow_handle(void *priv, GHOST_EventHandle evt)
|
||||
{
|
||||
LoggerWindow *lw = priv;
|
||||
GHOST_TEventType type = GHOST_GetEventType(evt);
|
||||
|
||||
@ -597,7 +616,8 @@ LoggerWindow *loggerwindow_new(MultiTestApp *app) {
|
||||
}
|
||||
}
|
||||
|
||||
void loggerwindow_log(LoggerWindow *lw, char *line) {
|
||||
void loggerwindow_log(LoggerWindow *lw, char *line)
|
||||
{
|
||||
if (lw->nloglines == lw->logsize) {
|
||||
lw->loglines = memdbl(lw->loglines, &lw->logsize, sizeof(*lw->loglines));
|
||||
}
|
||||
@ -608,7 +628,8 @@ void loggerwindow_log(LoggerWindow *lw, char *line) {
|
||||
GHOST_InvalidateWindow(lw->win);
|
||||
}
|
||||
|
||||
void loggerwindow_free(LoggerWindow *lw) {
|
||||
void loggerwindow_free(LoggerWindow *lw)
|
||||
{
|
||||
GHOST_SystemHandle sys = multitestapp_get_system(lw->app);
|
||||
int i;
|
||||
|
||||
@ -869,18 +890,21 @@ void multitestapp_toggle_extra_window(MultiTestApp *app) {
|
||||
}
|
||||
}
|
||||
|
||||
void multitestapp_exit(MultiTestApp *app) {
|
||||
void multitestapp_exit(MultiTestApp *app)
|
||||
{
|
||||
app->exit = 1;
|
||||
}
|
||||
|
||||
void multitestapp_run(MultiTestApp *app) {
|
||||
void multitestapp_run(MultiTestApp *app)
|
||||
{
|
||||
while (!app->exit) {
|
||||
GHOST_ProcessEvents(app->sys, 1);
|
||||
GHOST_DispatchEvents(app->sys);
|
||||
}
|
||||
}
|
||||
|
||||
void multitestapp_free(MultiTestApp *app) {
|
||||
void multitestapp_free(MultiTestApp *app)
|
||||
{
|
||||
mainwindow_free(app->main);
|
||||
loggerwindow_free(app->logger);
|
||||
GHOST_DisposeSystem(app->sys);
|
||||
@ -889,7 +913,8 @@ void multitestapp_free(MultiTestApp *app) {
|
||||
|
||||
/***/
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#ifndef USE_BMF
|
||||
BLF_init(11, 72);
|
||||
#endif
|
||||
|
@ -96,7 +96,8 @@ int scrollbar_is_scrolling(ScrollBar *sb)
|
||||
{
|
||||
return sb->scrolling;
|
||||
}
|
||||
int scrollbar_contains_pt(ScrollBar *sb, int pt[2]) {
|
||||
int scrollbar_contains_pt(ScrollBar *sb, int pt[2])
|
||||
{
|
||||
return rect_contains_pt(sb->rect, pt);
|
||||
}
|
||||
|
||||
|
@ -545,7 +545,8 @@ static void MEM_printmemlist_internal(int pydict)
|
||||
mem_unlock_thread();
|
||||
}
|
||||
|
||||
void MEM_callbackmemlist(void (*func)(void *)) {
|
||||
void MEM_callbackmemlist(void (*func)(void *))
|
||||
{
|
||||
MemHead *membl;
|
||||
|
||||
mem_lock_thread();
|
||||
@ -563,7 +564,8 @@ void MEM_callbackmemlist(void (*func)(void *)) {
|
||||
mem_unlock_thread();
|
||||
}
|
||||
|
||||
short MEM_testN(void *vmemh) {
|
||||
short MEM_testN(void *vmemh)
|
||||
{
|
||||
MemHead *membl;
|
||||
|
||||
mem_lock_thread();
|
||||
@ -588,10 +590,12 @@ short MEM_testN(void *vmemh) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MEM_printmemlist(void) {
|
||||
void MEM_printmemlist(void)
|
||||
{
|
||||
MEM_printmemlist_internal(0);
|
||||
}
|
||||
void MEM_printmemlist_pydict(void) {
|
||||
void MEM_printmemlist_pydict(void)
|
||||
{
|
||||
MEM_printmemlist_internal(1);
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ int conv_utf_16_to_8(const wchar_t *in16, char *out8, size_t size8)
|
||||
else if (u < 0xD800 || u >= 0xE000) {
|
||||
if (out8 + 2 >= out8end) break;
|
||||
*out8++ = (0x7 << 5) | (0xF & (u >> 12));
|
||||
*out8++ = (0x1 << 7) | (0x3F & (u >> 6));;
|
||||
*out8++ = (0x1 << 7) | (0x3F & (u >> 6));
|
||||
*out8 = (0x1 << 7) | (0x3F & (u));
|
||||
}
|
||||
else if (u < 0xDC00) {
|
||||
|
@ -58,8 +58,7 @@
|
||||
#include "RNA_access.h"
|
||||
|
||||
/* **** XXX **** */
|
||||
static void error(const char *UNUSED(error), ...) {
|
||||
}
|
||||
static void error(const char *UNUSED(error), ...) {}
|
||||
|
||||
#define INT 96
|
||||
#define FLO 128
|
||||
|
@ -1134,15 +1134,18 @@ static float turbulencep(float noisesize, float x, float y, float z, int nr)
|
||||
/* Camberra omitted, didn't seem useful */
|
||||
|
||||
/* distance squared */
|
||||
static float dist_Squared(float x, float y, float z, float e) {
|
||||
static float dist_Squared(float x, float y, float z, float e)
|
||||
{
|
||||
(void)e; return (x * x + y * y + z * z);
|
||||
}
|
||||
/* real distance */
|
||||
static float dist_Real(float x, float y, float z, float e) {
|
||||
static float dist_Real(float x, float y, float z, float e)
|
||||
{
|
||||
(void)e; return sqrtf(x * x + y * y + z * z);
|
||||
}
|
||||
/* manhattan/taxicab/cityblock distance */
|
||||
static float dist_Manhattan(float x, float y, float z, float e) {
|
||||
static float dist_Manhattan(float x, float y, float z, float e)
|
||||
{
|
||||
(void)e; return (fabsf(x) + fabsf(y) + fabsf(z));
|
||||
}
|
||||
/* Chebychev */
|
||||
|
@ -4226,8 +4226,8 @@ static int armature_select_similar_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void ARMATURE_OT_select_similar(wmOperatorType *ot) {
|
||||
|
||||
void ARMATURE_OT_select_similar(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Select Similar";
|
||||
ot->idname = "ARMATURE_OT_select_similar";
|
||||
|
@ -109,8 +109,7 @@ static void waitcursor(int UNUSED(val)) {}
|
||||
static int pupmenu(const char *UNUSED(msg)) {return 0;}
|
||||
|
||||
/* port over here */
|
||||
static void error_libdata(void) {
|
||||
}
|
||||
static void error_libdata(void) {}
|
||||
|
||||
Object *ED_object_context(bContext *C)
|
||||
{
|
||||
|
@ -2186,7 +2186,8 @@ static void node_composit_buts_colorcorrection(uiLayout *layout, bContext *UNUSE
|
||||
uiItemR(row, ptr, "midtones_end", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
||||
}
|
||||
|
||||
static void node_composit_buts_colorcorrection_but(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) {
|
||||
static void node_composit_buts_colorcorrection_but(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
|
||||
{
|
||||
uiLayout *row;
|
||||
|
||||
row = uiLayoutRow(layout, 0);
|
||||
|
@ -120,14 +120,17 @@ int ismovie(const char *UNUSED(filepath))
|
||||
}
|
||||
|
||||
/* never called, just keep the linker happy */
|
||||
static int startmovie(struct anim *UNUSED(anim)) {
|
||||
static int startmovie(struct anim *UNUSED(anim))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
static ImBuf *movie_fetchibuf(struct anim *UNUSED(anim), int UNUSED(position)) {
|
||||
static ImBuf *movie_fetchibuf(struct anim *UNUSED(anim), int UNUSED(position))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static void free_anim_movie(struct anim *UNUSED(anim)) {
|
||||
;
|
||||
static void free_anim_movie(struct anim *UNUSED(anim))
|
||||
{
|
||||
/* pass */
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user