1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-27 15:50:10 +01:00

lib-src/portsmf: string literals as const char *, not char *

This commit is contained in:
Paul Licameli
2018-07-23 15:31:29 -04:00
parent 7c25e555ac
commit 263fbff02c
4 changed files with 22 additions and 22 deletions

View File

@@ -39,7 +39,7 @@ public:
long parse_int(string &field);
int find_real_in(string &field, int n);
double parse_real(string &field);
void parse_error(string &field, long offset, char *message);
void parse_error(string &field, long offset, const char *message);
double parse_dur(string &field, double base);
double parse_after_dur(double dur, string &field, int n, double base);
double parse_loud(string &field);
@@ -422,7 +422,7 @@ bool Alg_reader::parse()
long Alg_reader::parse_chan(string &field)
{
const char *int_string = field.c_str() + 1;
char *msg = "Integer or - expected";
const char *msg = "Integer or - expected";
const char *p = int_string;
char c;
// check that all chars in int_string are digits or '-':
@@ -449,7 +449,7 @@ long Alg_reader::parse_chan(string &field)
long Alg_reader::parse_int(string &field)
{
const char *int_string = field.c_str() + 1;
char *msg = "Integer expected";
const char *msg = "Integer expected";
const char *p = int_string;
char c;
// check that all chars in int_string are digits:
@@ -491,7 +491,7 @@ int Alg_reader::find_real_in(string &field, int n)
double Alg_reader::parse_real(string &field)
{
char *msg = "Real expected";
const char *msg = "Real expected";
int last = find_real_in(field, 1);
string real_string = field.substr(1, last - 1);
if (last <= 1 || last < (int) field.length()) {
@@ -502,7 +502,7 @@ double Alg_reader::parse_real(string &field)
}
void Alg_reader::parse_error(string &field, long offset, char *message)
void Alg_reader::parse_error(string &field, long offset, const char *message)
{
int position = line_parser.pos - field.length() + offset;
error_flag = true;
@@ -520,9 +520,9 @@ double duration_lookup[] = { 0.25, 0.5, 1.0, 2.0, 4.0 };
double Alg_reader::parse_dur(string &field, double base)
{
char *msg = "Duration expected";
char *durs = "SIQHW";
char *p;
const char *msg = "Duration expected";
const char *durs = "SIQHW";
const char *p;
int last;
double dur;
if (field.length() < 2) {
@@ -578,7 +578,7 @@ double Alg_reader::parse_after_dur(double dur, string &field,
}
struct loud_lookup_struct {
char *str;
const char *str;
int val;
} loud_lookup[] = { {"FFF", 127}, {"FF", 120}, {"F", 110}, {"MF", 100},
{"MP", 90}, {"P", 80}, {"PP", 70}, {"PPP", 60},
@@ -587,7 +587,7 @@ struct loud_lookup_struct {
double Alg_reader::parse_loud(string &field)
{
char *msg = "Loudness expected";
const char *msg = "Loudness expected";
if (isdigit(field[1])) {
return parse_int(field);
} else {
@@ -613,9 +613,9 @@ int key_lookup[] = {21, 23, 12, 14, 16, 17, 19};
//
long Alg_reader::parse_key(string &field)
{
char *msg = "Pitch expected";
char *pitches = "ABCDEFG";
char *p;
const char *msg = "Pitch expected";
const char *pitches = "ABCDEFG";
const char *p;
if (isdigit(field[1])) {
// This routine would not have been called if field = "P<number>"
// so it must be "K<number>" so <number> must be an integer.