Index: png.c =================================================================== --- png.c (revision 28094) +++ png.c (revision 28095) @@ -412,7 +412,7 @@ static pcb_layergrp_id_t group_for_layer(int l) { - if (l < pcb_max_layer && l >= 0) + if (l < pcb_max_layer(PCB) && l >= 0) return pcb_layer_get_group(PCB, l); /* else something unique */ return pcb_max_group(PCB) + 3 + l; @@ -429,7 +429,7 @@ pcb_layergrp_id_t bl = group_for_layer(b); int d = bl - al; - if (a >= 0 && a < pcb_max_layer) { + if (a >= 0 && a < pcb_max_layer(PCB)) { int aside = (is_solder(al) ? 0 : is_component(al) ? 2 : 1); int bside = (is_solder(bl) ? 0 : is_component(bl) ? 2 : 1); @@ -550,7 +550,7 @@ /* conf_force_set_bool(conf_core.editor.check_planes, 0);*/ conf_force_set_bool(conf_core.editor.show_solder_side, 0); - qsort(pcb_layer_stack, pcb_max_layer, sizeof(pcb_layer_stack[0]), layer_sort); + qsort(pcb_layer_stack, pcb_max_layer(PCB), sizeof(pcb_layer_stack[0]), layer_sort); if (photo_mode) png_photo_as_shown(); @@ -561,7 +561,7 @@ if (!photo_mode && conf_core.editor.show_solder_side) { int i, j; - for (i = 0, j = pcb_max_layer - 1; i < j; i++, j--) { + for (i = 0, j = pcb_max_layer(PCB) - 1; i < j; i++, j--) { int k = pcb_layer_stack[i]; pcb_layer_stack[i] = pcb_layer_stack[j]; pcb_layer_stack[j] = k;