mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-22 01:33:23 -10:00
Scan on the Playlists tab picks one of the other playlists through menu_playlists_tab_random_selection(), shared by all four menu drivers, and does nothing when there is no other playlist. random_range() now stays inside its inclusive range for every rand() value. Tests: samples/menu/playlists_scan presses Scan with zero, one and two playlists on each driver; samples/menu/random_range holds random_range() to its range and an even spread across it.
27 lines
1.0 KiB
Makefile
27 lines
1.0 KiB
Makefile
# libretro-common's random_range(), which the menu's Scan picks rows
|
|
# with, held to its inclusive range and an even spread across it: once
|
|
# with the host's rand() range, once with a 15-bit one as MSVC and
|
|
# mingw have.
|
|
|
|
TARGET := random_range_test
|
|
REPO_ROOT := ../../..
|
|
SOURCES := random_range_test.c
|
|
CFLAGS += -Wall -std=c89 -pedantic -Wno-long-long -g1 -O1 \
|
|
-I$(REPO_ROOT)/libretro-common/include
|
|
ifneq ($(SANITIZER),)
|
|
CFLAGS := -fsanitize=$(SANITIZER) -fno-omit-frame-pointer $(CFLAGS)
|
|
LDFLAGS := -fsanitize=$(SANITIZER) $(LDFLAGS)
|
|
endif
|
|
|
|
all: $(TARGET) $(TARGET)_rand15
|
|
$(TARGET): $(SOURCES) $(REPO_ROOT)/libretro-common/include/retro_math.h
|
|
$(CC) $(CFLAGS) -o $@ $(SOURCES) $(LDFLAGS) $(LDLIBS)
|
|
$(TARGET)_rand15: $(SOURCES) $(REPO_ROOT)/libretro-common/include/retro_math.h
|
|
$(CC) $(CFLAGS) -DTEST_RAND_MAX=32767 -o $@ $(SOURCES) $(LDFLAGS) $(LDLIBS)
|
|
check: all
|
|
./$(TARGET)
|
|
./$(TARGET)_rand15
|
|
clean:
|
|
rm -f $(TARGET) $(TARGET).exe $(TARGET)_rand15 $(TARGET)_rand15.exe
|
|
.PHONY: all check clean
|