diff --git a/src/86box.c b/src/86box.c index 235a1fd5d..147233b21 100644 --- a/src/86box.c +++ b/src/86box.c @@ -17,8 +17,8 @@ * Copyright 2008-2020 Sarah Walker. * Copyright 2016-2020 Miran Grca. * Copyright 2017-2020 Fred N. van Kempen. - * Copyright 2021 Laci bá' - * Copyright 2021 dob205 + * Copyright 2021 Laci bá' + * Copyright 2021 dob205 */ #include #include diff --git a/src/codegen/codegen_ops_fpu.h b/src/codegen/codegen_ops_fpu.h index 58a5adf7d..4ffbb45a0 100644 --- a/src/codegen/codegen_ops_fpu.h +++ b/src/codegen/codegen_ops_fpu.h @@ -667,14 +667,16 @@ ropFCHS(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb return op_pc; \ } +// clang-format off opFLDimm(1, 1.0) - opFLDimm(L2T, 3.3219280948873623) - opFLDimm(L2E, 1.4426950408889634); +opFLDimm(L2T, 3.3219280948873623) +opFLDimm(L2E, 1.4426950408889634); opFLDimm(PI, 3.141592653589793); opFLDimm(EG2, 0.3010299956639812); opFLDimm(Z, 0.0) +// clang-format on - static uint32_t ropFLDLN2(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) +static uint32_t ropFLDLN2(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) { FP_ENTER(); FP_LOAD_IMM_Q(0x3fe62e42fefa39f0ull); diff --git a/src/codegen/codegen_x86-64.c b/src/codegen/codegen_x86-64.c index 6939819d4..4a184b981 100644 --- a/src/codegen/codegen_x86-64.c +++ b/src/codegen/codegen_x86-64.c @@ -485,48 +485,51 @@ codegen_flush(void) return; } +// clang-format off static int opcode_modrm[256] = { - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*00*/ - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*10*/ - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 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/*d0*/ - 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*e0*/ - 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/ + 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, /*c0*/ + 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*d0*/ + 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*e0*/ + 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/ }; +// clang-format off void codegen_debug(void) diff --git a/src/codegen/codegen_x86.c b/src/codegen/codegen_x86.c index 61b473fe7..bd9793732 100644 --- a/src/codegen/codegen_x86.c +++ b/src/codegen/codegen_x86.c @@ -1627,48 +1627,51 @@ codegen_flush(void) return; } +// clang-format off static int opcode_modrm[256] = { - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*00*/ - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*10*/ - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*20*/ - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*30*/ + 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*00*/ + 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*10*/ + 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*20*/ + 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*30*/ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*40*/ - 0, 0, 0, 0, 0, 0, 0, 0,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en_new/codegen.c b/src/codegen_new/codegen.c index 2f178bc74..bf6ad123c 100644 --- a/src/codegen_new/codegen.c +++ b/src/codegen_new/codegen.c @@ -322,48 +322,51 @@ codegen_generate_ea(ir_data_t *ir, x86seg *op_ea_seg, uint32_t fetchdat, int op_ return codegen_generate_ea_16_long(ir, op_ea_seg, fetchdat, op_ssegs, op_pc); } +// clang-format off static uint8_t opcode_modrm[256] = { - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*00*/ - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*10*/ - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*20*/ - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*30*/ + 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*00*/ + 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*10*/ + 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*20*/ + 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, /*30*/ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*40*/ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*50*/ - 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, /*60*/ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*70*/ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*40*/ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*50*/ + 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 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1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, /*b0*/ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*80*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*90*/ + 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, /*a0*/ + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, /*b0*/ - 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, /*c0*/ - 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*d0*/ - 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*e0*/ - 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/ + 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, /*c0*/ + 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*d0*/ + 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, /*e0*/ + 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0 /*f0*/ }; +// clang-format on void codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_pc, uint32_t old_pc) diff --git a/src/codegen_new/codegen_ops_3dnow.c b/src/codegen_new/codegen_ops_3dnow.c index ff0c136e2..c2b04584c 100644 --- a/src/codegen_new/codegen_ops_3dnow.c +++ b/src/codegen_new/codegen_ops_3dnow.c @@ -37,16 +37,18 @@ return op_pc + 2; \ } +// clang-format off ropParith(PFADD) - ropParith(PFCMPEQ) - ropParith(PFCMPGE) - ropParith(PFCMPGT) - ropParith(PFMAX) - ropParith(PFMIN) - ropParith(PFMUL) - ropParith(PFSUB) +ropParith(PFCMPEQ) +ropParith(PFCMPGE) +ropParith(PFCMPGT) +ropParith(PFMAX) +ropParith(PFMIN) +ropParith(PFMUL) +ropParith(PFSUB) +// clang-format on - uint32_t ropPF2ID(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) +uint32_t ropPF2ID(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) { int dest_reg = (fetchdat >> 3) & 7; diff --git a/src/codegen_new/codegen_ops_fpu_arith.c b/src/codegen_new/codegen_ops_fpu_arith.c index e9739f830..98d77250c 100644 --- a/src/codegen_new/codegen_ops_fpu_arith.c +++ b/src/codegen_new/codegen_ops_fpu_arith.c @@ -423,8 +423,10 @@ ropFUCOMPP(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, return op_pc + 1; \ } +// clang-format off ropF_arith_mem(s, uop_MEM_LOAD_SINGLE) - ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) +ropF_arith_mem(d, uop_MEM_LOAD_DOUBLE) +// clang-format on #define ropFI_arith_mem(name, temp_reg) \ uint32_t ropFIADD##name(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc) \ diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 5030d9ff7..1ab06205f 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -1170,7 +1170,7 @@ cpu_set(void) #endif if ((cpu_s->cpu_type == CPU_K6_2P) || (cpu_s->cpu_type == CPU_K6_3P)) { - x86_opcodes_3DNOW = ops_3DNOWE; + x86_opcodes_3DNOW = ops_3DNOWE; #ifdef USE_DYNAREC x86_dynarec_opcodes_3DNOW = dynarec_ops_3DNOWE; #endif diff --git a/src/cpu/x87_ops_arith.h b/src/cpu/x87_ops_arith.h index f5e5d7696..e2dbbdb8f 100644 --- a/src/cpu/x87_ops_arith.h +++ b/src/cpu/x87_ops_arith.h @@ -125,25 +125,27 @@ return 0; \ } +// clang-format off opFPU(s, x87_ts, 16, t.i, geteal, t.s, _32) #ifndef FPU_8087 opFPU(s, x87_ts, 32, t.i, geteal, t.s, _32) #endif - opFPU(d, x87_td, 16, t.i, geteaq, t.d, _64) + opFPU(d, x87_td, 16, t.i, geteaq, t.d, _64) #ifndef FPU_8087 - opFPU(d, x87_td, 32, t.i, geteaq, t.d, _64) + opFPU(d, x87_td, 32, t.i, geteaq, t.d, _64) #endif - opFPU(iw, uint16_t, 16, t, geteaw, (double) (int16_t) t, _i16) +opFPU(iw, uint16_t, 16, t, geteaw, (double) (int16_t) t, _i16) #ifndef FPU_8087 - opFPU(iw, uint16_t, 32, t, geteaw, (double) (int16_t) t, _i16) + opFPU(iw, uint16_t, 32, t, geteaw, (double) (int16_t) t, _i16) #endif - opFPU(il, uint32_t, 16, t, geteal, (double) (int32_t) t, _i32) + opFPU(il, uint32_t, 16, t, geteal, (double) (int32_t) t, _i32) #ifndef FPU_8087 - opFPU(il, uint32_t, 32, t, geteal, (double) (int32_t) t, _i32) + opFPU(il, uint32_t, 32, t, geteal, (double) (int32_t) t, _i32) #endif +// clang-format on - static int opFADD(uint32_t fetchdat) +static int opFADD(uint32_t fetchdat) { FP_ENTER(); cpu_state.pc++; diff --git a/src/include/86box/config.h b/src/include/86box/config.h index 9946a0da3..dd873d168 100644 --- a/src/include/86box/config.h +++ b/src/include/86box/config.h @@ -28,109 +28,109 @@ extern "C" { #if 0 typedef struct { - uint8_t id, - uint8_t bus_type, /* Bus type: IDE, SCSI, etc. */ - bus, :4, /* ID of the bus (for example, for IDE, - 0 = primary, 1 = secondary, etc. */ - bus_id, :4, /* ID of the device on the bus */ - uint8_t type, /* Type flags, interpretation depends - on the device */ - uint8_t is_image; /* This is only used for CD-ROM: - 0 = Image; - 1 = Host drive */ + uint8_t id, + uint8_t bus_type, /* Bus type: IDE, SCSI, etc. */ + bus, : 4, /* ID of the bus (for example, for IDE, + 0 = primary, 1 = secondary, etc. */ + bus_id, : 4, /* ID of the device on the bus */ + uint8_t type, /* Type flags, interpretation depends + on the device */ + uint8_t is_image; /* This is only used for CD-ROM: + 0 = Image; + 1 = Host drive */ - wchar_t path[1024]; /* Name of current image file or - host drive */ + wchar_t path[1024]; /* Name of current image file or + host drive */ - uint32_t spt, /* Physical geometry parameters */ - hpc, - tracks; + uint32_t spt, /* Physical geometry parameters */ + hpc, + tracks; } storage_cfg_t; typedef struct { /* General configuration */ - int vid_resize, /* Window is resizable or not */ - vid_renderer, /* Renderer */ - vid_fullscreen_scale, /* Full screen scale type */ - vid_fullscreen_start, /* Start emulator in full screen */ - vid_force_43, /* Force 4:3 display ratio in windowed mode */ - vid_scale, /* Windowed mode scale */ - vid_overscan, /* EGA/(S)VGA overscan enabled */ - vid_cga_contrast, /* CGA alternate contrast enabled */ - vid_grayscale, /* Video is grayscale */ - vid_grayscale_type, /* Video grayscale type */ - vid_invert_display, /* Invert display */ - rctrl_is_lalt, /* Right CTRL is left ALT */ - update_icons, /* Update status bar icons */ - window_remember, /* Remember window position and size */ - window_w, /* Window coordinates */ - window_h, - window_x, - window_y, - sound_gain; /* Sound gain */ + int vid_resize, /* Window is resizable or not */ + vid_renderer, /* Renderer */ + vid_fullscreen_scale, /* Full screen scale type */ + vid_fullscreen_start, /* Start emulator in full screen */ + vid_force_43, /* Force 4:3 display ratio in windowed mode */ + vid_scale, /* Windowed mode scale */ + vid_overscan, /* EGA/(S)VGA overscan enabled */ + vid_cga_contrast, /* CGA alternate contrast enabled */ + vid_grayscale, /* Video is grayscale */ + vid_grayscale_type, /* Video grayscale type */ + vid_invert_display, /* Invert display */ + rctrl_is_lalt, /* Right CTRL is left ALT */ + update_icons, /* Update status bar icons */ + window_remember, /* Remember window position and size */ + window_w, /* Window coordinates */ + window_h, + window_x, + window_y, + sound_gain; /* Sound gain */ # ifdef USE_LANGUAGE - uint16_t language_id; /* Language ID (0x0409 = English (US)) */ + uint16_t language_id; /* Language ID (0x0409 = English (US)) */ # endif /* Machine cateogory */ - int machine, /* Machine */ - cpu, /* CPU */ + int machine, /* Machine */ + cpu, /* CPU */ # ifdef USE_DYNAREC - cpu_use_dynarec, /* CPU recompiler enabled */ + cpu_use_dynarec, /* CPU recompiler enabled */ # endif - wait_states, /* CPU wait states */ - enable_external_fpu, /* FPU enabled */ - time_sync; /* Time sync enabled */ - uint32_t mem_size; /* Memory size */ + wait_states, /* CPU wait states */ + enable_external_fpu, /* FPU enabled */ + time_sync; /* Time sync enabled */ + uint32_t mem_size; /* Memory size */ /* Video category */ - int video_card, /* Video card */ - voodoo_enabled; /* Voodoo enabled */ + int video_card, /* Video card */ + voodoo_enabled; /* Voodoo enabled */ /* Input devices category */ - int mouse_type, /* Mouse type */ - joystick_type; /* Joystick type */ + int mouse_type, /* Mouse type */ + joystick_type; /* Joystick type */ /* Sound category */ - int sound_card, /* Sound card */ - midi_device, /* Midi device */ - mpu_401, /* Standalone MPU-401 enabled */ - ssi_2001_enabled, /* SSI-2001 enabled */ - game_blaster_enabled, /* Game blaster enabled */ - gus_enabled, /* Gravis Ultrasound enabled */ - opl_type, /* OPL emulation type */ - sound_is_float; /* Sound is 32-bit float or 16-bit integer */ + int sound_card, /* Sound card */ + midi_device, /* Midi device */ + mpu_401, /* Standalone MPU-401 enabled */ + ssi_2001_enabled, /* SSI-2001 enabled */ + game_blaster_enabled, /* Game blaster enabled */ + gus_enabled, /* Gravis Ultrasound enabled */ + opl_type, /* OPL emulation type */ + sound_is_float; /* Sound is 32-bit float or 16-bit integer */ /* Network category */ - int network_type, /* Network type (SLiRP or PCap) */ - network_card; /* Network card */ - char network_host[520]; /* PCap device */ + int network_type, /* Network type (SLiRP or PCap) */ + network_card; /* Network card */ + char network_host[520]; /* PCap device */ /* Ports category */ - char parallel_devices[PARALLEL_MAX][32]; /* LPT device names */ + char parallel_devices[PARALLEL_MAX][32]; /* LPT device names */ # ifdef USE_SERIAL_DEVICES - char serial_devices[SERIAL_MAX][32]; /* Serial device names */ + char serial_devices[SERIAL_MAX][32]; /* Serial device names */ # endif /* Other peripherals category */ - int fdc_type, /* Floppy disk controller type */ - hdc, /* Hard disk controller */ - scsi_card, /* SCSI controller */ - ide_ter_enabled, /* Tertiary IDE controller enabled */ - ide_qua_enabled, /* Quaternary IDE controller enabled */ - bugger_enabled, /* ISA bugger device enabled */ - isa_rtc_type, /* ISA RTC card */ - isa_mem_type[ISAMEM_MAX]; /* ISA memory boards */ + int fdc_type, /* Floppy disk controller type */ + hdc, /* Hard disk controller */ + scsi_card, /* SCSI controller */ + ide_ter_enabled, /* Tertiary IDE controller enabled */ + ide_qua_enabled, /* Quaternary IDE controller enabled */ + bugger_enabled, /* ISA bugger device enabled */ + isa_rtc_type, /* ISA RTC card */ + isa_mem_type[ISAMEM_MAX]; /* ISA memory boards */ /* Hard disks category */ - storage_cfg_t hdd[HDD_NUM]; /* Hard disk drives */ + storage_cfg_t hdd[HDD_NUM]; /* Hard disk drives */ /* Floppy drives category */ - storage_cfg_t fdd[FDD_NUM]; /* Floppy drives */ + storage_cfg_t fdd[FDD_NUM]; /* Floppy drives */ /* Other removable devices category */ - storage_cfg_t cdrom[CDROM_NUM], /* CD-ROM drives */ - storage_cfg_t rdisk[ZIP_NUM]; /* Removable disk drives */ + storage_cfg_t cdrom[CDROM_NUM], /* CD-ROM drives */ + storage_cfg_t rdisk[ZIP_NUM]; /* Removable disk drives */ } config_t; #endif diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 98252d49e..dc03cb417 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -13,7 +13,7 @@ # Copyright 2020,2021 David Hrdlička. # -add_library(net OBJECT network.c net_pcap.c net_slirp.c net_dp8390.c net_3c501.c +add_library(net OBJECT network.c net_pcap.c net_slirp.c net_dp8390.c net_3c501.c net_3c503.c net_ne2000.c net_pcnet.c net_wd8003.c net_plip.c net_event.c) option(SLIRP_EXTERNAL "Link against the system-provided libslirp library" OFF) diff --git a/src/qt/qt_newfloppydialog.cpp b/src/qt/qt_newfloppydialog.cpp index a445c47d3..bad4fbf9e 100644 --- a/src/qt/qt_newfloppydialog.cpp +++ b/src/qt/qt_newfloppydialog.cpp @@ -548,7 +548,7 @@ NewFloppyDialog::createZipSectorImage(const QString &filename, const disk_size_t empty[0x5003] = empty[0x1D003] = 0xFF; /* Root directory = 0x35000 - Data = 0x39000 */ + Data = 0x39000 */ } else { /* ZIP 250 */ /* MBR */ @@ -570,7 +570,7 @@ NewFloppyDialog::createZipSectorImage(const QString &filename, const disk_size_t memset(&(empty[0x0200]), 0x48, 0x3E00); /* The second sector begins with some strange data - in my reference image. */ + in my reference image. */ *(uint64_t *) &(empty[0x0200]) = 0x3831393230334409LL; *(uint64_t *) &(empty[0x0208]) = 0x6A57766964483130LL; *(uint64_t *) &(empty[0x0210]) = 0x3C3A34676063653FLL; @@ -619,7 +619,7 @@ NewFloppyDialog::createZipSectorImage(const QString &filename, const disk_size_t empty[0x4203] = empty[0x22003] = 0xFF; /* Root directory = 0x3FE00 - Data = 0x38200 */ + Data = 0x38200 */ } pbar.setMaximum(pbar_max); diff --git a/src/unix/CMakeLists.txt b/src/unix/CMakeLists.txt index 5301c9268..5fbcf0329 100644 --- a/src/unix/CMakeLists.txt +++ b/src/unix/CMakeLists.txt @@ -11,8 +11,8 @@ # Authors: Cacodemon345 # David Hrdlička, # -# Copyright 2021 Cacodemon345. -# Copyright 2021 David Hrdlička. +# Copyright 2021 Cacodemon345. +# Copyright 2021 David Hrdlička. # add_library(plat OBJECT unix.c) diff --git a/src/win/CMakeLists.txt b/src/win/CMakeLists.txt index 34e6dde9b..a0a4c8e14 100644 --- a/src/win/CMakeLists.txt +++ b/src/win/CMakeLists.txt @@ -10,7 +10,7 @@ # # Authors: David Hrdlička, # -# Copyright 2020,2021 David Hrdlička. +# Copyright 2020-2021 David Hrdlička. # enable_language(RC)