Compare commits
2 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| b1b20f6c66 | |||
|
|
6ce0c9777b |
223
bcal-gcc15.patch
Normal file
223
bcal-gcc15.patch
Normal file
@@ -0,0 +1,223 @@
|
||||
Index: bcal-2.4/src/bcal.c
|
||||
===================================================================
|
||||
--- bcal-2.4.orig/src/bcal.c
|
||||
+++ bcal-2.4/src/bcal.c
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
+#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@@ -31,9 +32,6 @@
|
||||
#include "dslib.h"
|
||||
#include "log.h"
|
||||
|
||||
-#define TRUE 1
|
||||
-#define FALSE !TRUE
|
||||
-
|
||||
#define SECTOR_SIZE 512 /* 0x200 */
|
||||
#define MAX_HEAD 16 /* 0x10 */
|
||||
#define MAX_SECTOR 63 /* 0x3f */
|
||||
@@ -44,7 +42,6 @@
|
||||
#define MAX_BITS 128
|
||||
#define ALIGNMENT_MASK_4BIT 0xF
|
||||
|
||||
-typedef unsigned char bool;
|
||||
typedef unsigned char uchar;
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned long ulong;
|
||||
@@ -172,8 +169,8 @@ static size_t bstrlcpy(char *dest, const
|
||||
static bool program_exit(const char *str)
|
||||
{
|
||||
if (!strcmp(str, "exit") || !strcmp(str, "quit"))
|
||||
- return TRUE;
|
||||
- return FALSE;
|
||||
+ return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -439,31 +436,31 @@ static bool ischarvalid(char ch, uint ba
|
||||
{
|
||||
if (ch == '0' || ch == '1') {
|
||||
*val = ch - '0';
|
||||
- return TRUE;
|
||||
+ return true;
|
||||
}
|
||||
} else if (base == 16) {
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
*val = ch - '0';
|
||||
- return TRUE;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
if (ch >= 'a' && ch <= 'f') {
|
||||
*val = (ch - 'a') + 10;
|
||||
- return TRUE;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
if (ch >= 'A' && ch <= 'F') {
|
||||
*val = (ch - 'A') + 10;
|
||||
- return TRUE;
|
||||
+ return true;
|
||||
}
|
||||
} else if (base == 10) {
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
*val = ch - '0';
|
||||
- return TRUE;
|
||||
+ return true;
|
||||
}
|
||||
}
|
||||
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1027,32 +1024,32 @@ static bool chs2lba(char *chs, maxuint_t
|
||||
/* Fail if CHS is omitted */
|
||||
if (token_no < 3) {
|
||||
log(ERROR, "CHS missing\n");
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
if (!param[3]) {
|
||||
log(ERROR, "MAX_HEAD = 0\n");
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
if (!param[4]) {
|
||||
log(ERROR, "MAX_SECTOR = 0\n");
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
if (!param[2]) {
|
||||
log(ERROR, "S = 0\n");
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
if (param[1] > param[3]) {
|
||||
log(ERROR, "H > MAX_HEAD\n");
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
if (param[2] > param[4]) {
|
||||
log(ERROR, "S > MAX_SECTOR\n");
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
*lba = (maxuint_t)param[3] * param[4] * param[0]; /* MH * MS * C */
|
||||
@@ -1064,7 +1061,7 @@ static bool chs2lba(char *chs, maxuint_t
|
||||
printf(" C:%lu H:%lu S:%lu MAX_HEAD:%lu MAX_SECTOR:%lu\n",
|
||||
param[0], param[1], param[2], param[3], param[4]);
|
||||
|
||||
- return TRUE;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
static bool lba2chs(char *lba, t_chs *p_chs)
|
||||
@@ -1103,17 +1100,17 @@ static bool lba2chs(char *lba, t_chs *p_
|
||||
/* Fail if LBA is omitted */
|
||||
if (!token_no) {
|
||||
log(ERROR, "LBA missing\n");
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
if (!param[1]) {
|
||||
log(ERROR, "MAX_HEAD = 0\n");
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
if (!param[2]) {
|
||||
log(ERROR, "MAX_SECTOR = 0\n");
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/* L / (MS * MH) */
|
||||
@@ -1122,14 +1119,14 @@ static bool lba2chs(char *lba, t_chs *p_
|
||||
p_chs->h = (ulong)((param[0] / param[2]) % param[1]);
|
||||
if (p_chs->h > MAX_HEAD) {
|
||||
log(ERROR, "H > MAX_HEAD\n");
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
/* (L % MS) + 1 */
|
||||
p_chs->s = (ulong)((param[0] % param[2]) + 1);
|
||||
if (p_chs->s > MAX_SECTOR) {
|
||||
log(ERROR, "S > MAX_SECTOR\n");
|
||||
- return FALSE;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
printf("\033[1mLBA2CHS\033[0m\n LBA:%s ",
|
||||
@@ -1137,7 +1134,7 @@ static bool lba2chs(char *lba, t_chs *p_
|
||||
printf("MAX_HEAD:%s ", getstr_u128(param[1], uint_buf));
|
||||
printf("MAX_SECTOR:%s\n", getstr_u128(param[2], uint_buf));
|
||||
|
||||
- return TRUE;
|
||||
+ return true;
|
||||
}
|
||||
|
||||
static void show_basic_sizes()
|
||||
@@ -1318,7 +1315,7 @@ static int infix2postfix(char *exp, queu
|
||||
char *token = strtok(exp, " ");
|
||||
static Data tokenData, ct;
|
||||
int balanced = 0;
|
||||
- bool tokenize = TRUE;
|
||||
+ bool tokenize = true;
|
||||
|
||||
tokenData.p[0] = '\0';
|
||||
tokenData.unit = 0;
|
||||
@@ -1391,7 +1388,7 @@ static int infix2postfix(char *exp, queu
|
||||
tokenData.unit = 1;
|
||||
log(DEBUG, "unit found\n");
|
||||
} else
|
||||
- tokenize = FALSE; /* We already toknized here */
|
||||
+ tokenize = false; /* We already toknized here */
|
||||
|
||||
/* Enqueue operands */
|
||||
log(DEBUG, "tokenData: %s %d\n", tokenData.p, tokenData.unit);
|
||||
@@ -1403,7 +1400,7 @@ static int infix2postfix(char *exp, queu
|
||||
if (tokenize)
|
||||
token = strtok(NULL, " ");
|
||||
else
|
||||
- tokenize = TRUE;
|
||||
+ tokenize = true;
|
||||
|
||||
log(DEBUG, "token: %s\n", token);
|
||||
}
|
||||
@@ -2062,7 +2059,7 @@ int main(int argc, char **argv)
|
||||
ulong sectorsz = SECTOR_SIZE;
|
||||
|
||||
if (getenv("BCAL_USE_CALC"))
|
||||
- cfg.calc = TRUE;
|
||||
+ cfg.calc = true;
|
||||
|
||||
opterr = 0;
|
||||
rl_bind_key('\t', rl_insert);
|
||||
diff --git a/src/bcal.c b/src/bcal.c
|
||||
index 57dfb1e..7b3de31 100644
|
||||
--- a/src/bcal.c
|
||||
+++ b/src/bcal.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <signal.h>
|
||||
+#include <getopt.h>
|
||||
#include <readline/history.h>
|
||||
#include <readline/readline.h>
|
||||
#include "dslib.h"
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 15 11:59:06 UTC 2025 - pgajdos@suse.com
|
||||
|
||||
- added patches
|
||||
https://github.com/jarun/bcal/commit/b9de4fa9c0e29c2a4d55ddde007111c029364f6c
|
||||
https://github.com/jarun/bcal/commit/ea290b19c0ba0c7a8e34c640eac1260dc0b7269a
|
||||
+ bcal-gcc15.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 18 15:16:35 UTC 2022 - Ferdinand Thiessen <rpm@fthiessen.de>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package bcal
|
||||
#
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
# Copyright (c) 2018 Dilawar Singh <dilawar.s.rajput@gmail.com>
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
@@ -25,6 +25,8 @@ URL: http://www.github.com/jarun/bcal
|
||||
Version: 2.4
|
||||
Release: 0
|
||||
Source0: https://github.com/jarun/bcal/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
# https://github.com/jarun/bcal/commit/b9de4fa9c0e29c2a4d55ddde007111c029364f6c
|
||||
Patch0: bcal-gcc15.patch
|
||||
BuildRequires: readline-devel
|
||||
ExcludeArch: %ix86 %arm %ppc
|
||||
|
||||
@@ -36,7 +38,7 @@ and cannot calculate the hex address offset for (512 - 16) MiB immediately, or
|
||||
the value when the 43rd bit of a 64-bit address is set, bcal is for you.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags}"
|
||||
|
||||
Reference in New Issue
Block a user