Cleanup: use C++ includes, various non-functional changes for C++

This commit is contained in:
Campbell Barton
2023-08-02 20:15:49 +10:00
parent b655571f70
commit 7cc3ef3260
17 changed files with 33 additions and 33 deletions

View File

@@ -280,7 +280,7 @@ DEPS_CRITICAL_SUBPACKAGES = (
distro_package_names={DISTRO_ID_DEBIAN: "libegl-dev",
DISTRO_ID_FEDORA: "mesa-libEGL-devel",
DISTRO_ID_SUSE: "Mesa-libEGL-devel",
DISTRO_ID_ARCH: None, # Included in libglvnd.
DISTRO_ID_ARCH: None, # Included in `libglvnd`.
},
),
)

View File

@@ -9,7 +9,7 @@
* \ingroup GHOST
*/
#include <stdio.h>
#include <cstdio>
#ifdef WITH_X11_XF86VMODE
# include <X11/Xlib.h>

View File

@@ -8,8 +8,8 @@
/* Logging, use `ghost.ndof.unix.*` prefix. */
#include "CLG_log.h"
#include <cstdio>
#include <spnav.h>
#include <stdio.h>
#include <unistd.h>
static const char *spnav_sock_path = "/var/run/spnav.sock";

View File

@@ -187,12 +187,12 @@ static void mainwindow_do_key(MainWindow *mw, GHOST_TKey key, int press)
break;
case GHOST_kKeyLeftBracket:
if (press) {
GHOST_SetCursorVisibility(mw->win, 0);
GHOST_SetCursorVisibility(mw->win, false);
}
break;
case GHOST_kKeyRightBracket:
if (press) {
GHOST_SetCursorVisibility(mw->win, 1);
GHOST_SetCursorVisibility(mw->win, true);
}
break;
case GHOST_kKeyE:

View File

@@ -1404,7 +1404,7 @@ static void particle_batch_cache_ensure_pos(Object *object,
for (curr_point = 0, i = 0, pa = psys->particles; i < psys->totpart; i++, pa++) {
state.time = DEG_get_ctime(draw_ctx->depsgraph);
if (!psys_get_particle_state(&sim, i, &state, 0)) {
if (!psys_get_particle_state(&sim, i, &state, false)) {
continue;
}

View File

@@ -8,7 +8,7 @@
* GPU fluid drawing functions.
*/
#include <string.h>
#include <cstring>
#include "BLI_listbase.h"
#include "BLI_math.h"
@@ -179,7 +179,7 @@ static GPUTexture *create_volume_texture(const int dim[3],
return nullptr;
}
while (1) {
while (true) {
tex = GPU_texture_create_3d("volume",
UNPACK3(final_dim),
1,

View File

@@ -6,7 +6,7 @@
* \ingroup draw
*/
#include <stdio.h>
#include <cstdio>
#include "BLI_alloca.h"
#include "BLI_listbase.h"

View File

@@ -1323,7 +1323,7 @@ static bool view3d_panel_vgroup_poll(const bContext *C, PanelType * /*pt*/)
return false;
}
static void update_active_vertex_weight(struct bContext *C, void *arg1, void * /*arg2*/)
static void update_active_vertex_weight(bContext *C, void *arg1, void * /*arg2*/)
{
View3D *v3d = CTX_wm_view3d(C);
TransformProperties *tfp = v3d_transform_props_ensure(v3d);
@@ -1435,7 +1435,7 @@ static void view3d_panel_vgroup(const bContext *C, Panel *panel)
UI_but_number_step_size_set(but, 1);
UI_but_number_precision_set(but, 3);
UI_but_drawflag_enable(but, UI_BUT_TEXT_LEFT);
UI_but_func_set(but, update_active_vertex_weight, POINTER_FROM_INT(i), NULL);
UI_but_func_set(but, update_active_vertex_weight, POINTER_FROM_INT(i), nullptr);
if (locked) {
lock_count++;
}

View File

@@ -8,8 +8,8 @@
* GPU immediate mode drawing utilities
*/
#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <cstring>
#include "BLI_math.h"
#include "BLI_utildefines.h"

View File

@@ -8,8 +8,8 @@
* Manages materials, lights and textures.
*/
#include <math.h>
#include <string.h>
#include <cmath>
#include <cstring>
#include "MEM_guardedalloc.h"

View File

@@ -8,9 +8,9 @@
* Custom select code for picking small regions (not efficient for large regions).
* `gpu_select_pick_*` API.
*/
#include <float.h>
#include <stdlib.h>
#include <string.h>
#include <cfloat>
#include <cstdlib>
#include <cstring>
#include "GPU_debug.h"
#include "GPU_framebuffer.h"

View File

@@ -8,7 +8,7 @@
* System that manages viewport drawing.
*/
#include <string.h>
#include <cstring>
#include "BLI_math_vector.h"
#include "BLI_rect.h"

View File

@@ -8,11 +8,11 @@
* This is external code.
*/
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cctype>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#ifdef WIN32
# include "BLI_winstuff.h"

View File

@@ -9,9 +9,9 @@
* endianness of the system.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "AVI_avi.h"
#include "avi_endian.h"

View File

@@ -8,8 +8,8 @@
* This is external code. Converts between AVI and MPEG/JPEG.
*/
#include <stdlib.h>
#include <string.h>
#include <cstdlib>
#include <cstring>
#include "AVI_avi.h"

View File

@@ -8,8 +8,8 @@
* This is external code. Converts RGB-type AVI files.
*/
#include <stdlib.h>
#include <string.h>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"

View File

@@ -8,8 +8,8 @@
* This is external code. Converts between rgb32 and avi.
*/
#include <stdlib.h>
#include <string.h>
#include <cstdlib>
#include <cstring>
#include "MEM_guardedalloc.h"