From ff155b6a31ba7727d9eac28c7bd9f2c944e9a34d Mon Sep 17 00:00:00 2001 From: hanez Date: Sat, 27 Sep 2025 10:12:44 +0200 Subject: [PATCH] Added some missing license headers and some cosmetic changes. --- examples/os_env.fun | 9 +++++++++ src/bytecode.c | 2 -- src/bytecode.h | 1 - src/value.h | 1 - src/vm/line.c | 9 +++++++++ src/vm/os/env.c | 11 +++++++++++ src/vm/sclamp.c | 9 +++++++++ src/vm/typeof.c | 9 +++++++++ src/vm/uclamp.c | 9 +++++++++ 9 files changed, 56 insertions(+), 4 deletions(-) diff --git a/examples/os_env.fun b/examples/os_env.fun index 4b2506f..63dc2e1 100644 --- a/examples/os_env.fun +++ b/examples/os_env.fun @@ -1,5 +1,14 @@ #!/usr/bin/env fun +/* + * This file is part of the Fun programming language. + * https://hanez.org/project/fun/ + * + * Copyright 2025 Johannes Findeisen + * Licensed under the terms of the ISC license. + * https://opensource.org/license/isc-license-txt + */ + // Environment variables via env(name): // - Returns the value as a string. // - If the variable is not set, returns an empty string. diff --git a/src/bytecode.c b/src/bytecode.c index 8ecb0d2..b098eee 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -7,10 +7,8 @@ * https://opensource.org/license/isc-license-txt */ - #include "bytecode.h" #include -#include #include Bytecode *bytecode_new(void) { diff --git a/src/bytecode.h b/src/bytecode.h index f475bab..03af038 100644 --- a/src/bytecode.h +++ b/src/bytecode.h @@ -7,7 +7,6 @@ * https://opensource.org/license/isc-license-txt */ - #ifndef FUN_BYTECODE_H #define FUN_BYTECODE_H diff --git a/src/value.h b/src/value.h index 3dd38ec..57ce712 100644 --- a/src/value.h +++ b/src/value.h @@ -35,7 +35,6 @@ * @date 2025-10-16 */ - #ifndef FUN_VALUE_H #define FUN_VALUE_H diff --git a/src/vm/line.c b/src/vm/line.c index d783d21..b7fe944 100644 --- a/src/vm/line.c +++ b/src/vm/line.c @@ -1,3 +1,12 @@ +/** +* This file is part of the Fun programming language. + * https://hanez.org/project/fun/ + * + * Copyright 2025 Johannes Findeisen + * Licensed under the terms of the ISC license. + * https://opensource.org/license/isc-license-txt + */ + case OP_LINE: { /* operand holds the source line number */ vm->current_line = inst.operand; diff --git a/src/vm/os/env.c b/src/vm/os/env.c index d90f473..5968472 100644 --- a/src/vm/os/env.c +++ b/src/vm/os/env.c @@ -1,3 +1,14 @@ +/** +* This file is part of the Fun programming language. + * https://hanez.org/project/fun/ + * + * Copyright 2025 Johannes Findeisen + * Licensed under the terms of the ISC license. + * https://opensource.org/license/isc-license-txt + */ + +// Get environment variables of the operation system. + case OP_ENV: { Value key = pop_value(vm); if (key.type != VAL_STRING) { diff --git a/src/vm/sclamp.c b/src/vm/sclamp.c index e085f5c..bf49d00 100644 --- a/src/vm/sclamp.c +++ b/src/vm/sclamp.c @@ -1,3 +1,12 @@ +/** +* This file is part of the Fun programming language. + * https://hanez.org/project/fun/ + * + * Copyright 2025 Johannes Findeisen + * Licensed under the terms of the ISC license. + * https://opensource.org/license/isc-license-txt + */ + case OP_SCLAMP: { /* Clamp/wrap to signed N-bit range: [-2^(N-1), 2^(N-1)-1] */ Value v = pop_value(vm); diff --git a/src/vm/typeof.c b/src/vm/typeof.c index 10287bd..34d1387 100644 --- a/src/vm/typeof.c +++ b/src/vm/typeof.c @@ -1,3 +1,12 @@ +/** +* This file is part of the Fun programming language. + * https://hanez.org/project/fun/ + * + * Copyright 2025 Johannes Findeisen + * Licensed under the terms of the ISC license. + * https://opensource.org/license/isc-license-txt + */ + case OP_TYPEOF: { Value v = pop_value(vm); const char *tname = "Unknown"; diff --git a/src/vm/uclamp.c b/src/vm/uclamp.c index 7294033..858847a 100644 --- a/src/vm/uclamp.c +++ b/src/vm/uclamp.c @@ -1,3 +1,12 @@ +/** +* This file is part of the Fun programming language. + * https://hanez.org/project/fun/ + * + * Copyright 2025 Johannes Findeisen + * Licensed under the terms of the ISC license. + * https://opensource.org/license/isc-license-txt + */ + case OP_UCLAMP: { /* Clamp/wrap the integer on top of the stack to 'bits' width (unsigned) */ Value v = pop_value(vm);