quiet warnings and fix building without python.

This commit is contained in:
Campbell Barton
2011-03-04 17:01:33 +00:00
parent 7006038b02
commit 9d5c6bbe3d
5 changed files with 11 additions and 6 deletions

View File

@@ -572,6 +572,7 @@ static int run_script_poll(bContext *C)
static int run_script(bContext *C, ReportList *reports)
{
#ifdef WITH_PYTHON
Text *text= CTX_data_edit_text(C);
const short is_live= (reports == NULL);
@@ -596,6 +597,10 @@ static int run_script(bContext *C, ReportList *reports)
BKE_report(reports, RPT_ERROR, "Python script fail, look in the console for now...");
}
#else
(void)C;
(void)reports;
#endif /* !WITH_PYTHON */
return OPERATOR_CANCELLED;
}
@@ -792,7 +797,7 @@ static int paste_exec(bContext *C, wmOperator *op)
/* run the script while editing, evil but useful */
if(CTX_wm_space_text(C)->live_edit)
run_script(C, NULL);
return OPERATOR_FINISHED;
}
@@ -863,7 +868,7 @@ static int cut_exec(bContext *C, wmOperator *UNUSED(op))
/* run the script while editing, evil but useful */
if(CTX_wm_space_text(C)->live_edit)
run_script(C, NULL);
return OPERATOR_FINISHED;
}

View File

@@ -1790,7 +1790,7 @@ static const char *rna_property_subtypename(PropertySubType type)
}
}
static const char *rna_property_subtype_unit(PropertyType type)
static const char *rna_property_subtype_unit(PropertySubType type)
{
switch(RNA_SUBTYPE_UNIT(type)) {
case PROP_UNIT_NONE: return "PROP_UNIT_NONE";

View File

@@ -1815,7 +1815,7 @@ void RNA_def_property_editable_array_func(PropertyRNA *prop, const char *editabl
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
{
if(!DefRNA.preprocess) {
fprintf(stderr, "RNA_def_struct_refine_func: only during preprocessing.\n");
fprintf(stderr, "RNA_def_property_update: only during preprocessing.\n");
return;
}

View File

@@ -2151,7 +2151,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
prop= RNA_def_property(srna, "resolution_percentage", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "size");
RNA_def_property_range(prop, 1, INT_MAX);
RNA_def_property_range(prop, 1, SHRT_MAX);
RNA_def_property_ui_range(prop, 1, 100, 10, 1);
RNA_def_property_ui_text(prop, "Resolution %", "Percentage scale for render resolution");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);

View File

@@ -2347,7 +2347,7 @@ static void ray_shadow_qmc(ShadeInput *shi, LampRen *lar, float *lampco, float *
samples++;
if ((lar->ray_samp_method == LA_SAMP_HALTON)) {
if (lar->ray_samp_method == LA_SAMP_HALTON) {
/* adaptive sampling - consider samples below threshold as in shadow (or vice versa) and exit early */
if ((max_samples > min_adapt_samples) && (adapt_thresh > 0.0) && (samples > max_samples / 3)) {