Pedantic, but let's use consistent type keywords

This commit is contained in:
Cinder Roxley
2024-06-30 17:47:14 -05:00
parent b0c29938cd
commit aa713bcae5
60 changed files with 746 additions and 746 deletions

View File

@@ -304,27 +304,27 @@ namespace LitJson
#region Implicit Conversions
public static implicit operator JsonData (Boolean data)
public static implicit operator JsonData (bool data)
{
return new JsonData (data);
}
public static implicit operator JsonData (Double data)
public static implicit operator JsonData (double data)
{
return new JsonData (data);
}
public static implicit operator JsonData (Int32 data)
public static implicit operator JsonData (int data)
{
return new JsonData (data);
}
public static implicit operator JsonData (Int64 data)
public static implicit operator JsonData (long data)
{
return new JsonData (data);
}
public static implicit operator JsonData (String data)
public static implicit operator JsonData (string data)
{
return new JsonData (data);
}
@@ -332,7 +332,7 @@ namespace LitJson
#region Explicit Conversions
public static explicit operator Boolean (JsonData data)
public static explicit operator bool (JsonData data)
{
if (data.type != JsonType.Boolean)
throw new InvalidCastException (
@@ -341,7 +341,7 @@ namespace LitJson
return data.inst_boolean;
}
public static explicit operator Double (JsonData data)
public static explicit operator double (JsonData data)
{
if (data.type != JsonType.Double)
throw new InvalidCastException (
@@ -350,7 +350,7 @@ namespace LitJson
return data.inst_double;
}
public static explicit operator Int32 (JsonData data)
public static explicit operator int (JsonData data)
{
if (data.type != JsonType.Int)
throw new InvalidCastException (
@@ -359,7 +359,7 @@ namespace LitJson
return data.inst_int;
}
public static explicit operator Int64 (JsonData data)
public static explicit operator long (JsonData data)
{
if (data.type != JsonType.Long)
throw new InvalidCastException (
@@ -368,7 +368,7 @@ namespace LitJson
return data.inst_long;
}
public static explicit operator String (JsonData data)
public static explicit operator string (JsonData data)
{
if (data.type != JsonType.String)
throw new InvalidCastException (
@@ -790,23 +790,23 @@ namespace LitJson
break;
case JsonType.String:
inst_string = default (String);
inst_string = default (string);
break;
case JsonType.Int:
inst_int = default (Int32);
inst_int = default (int);
break;
case JsonType.Long:
inst_long = default (Int64);
inst_long = default (long);
break;
case JsonType.Double:
inst_double = default (Double);
inst_double = default (double);
break;
case JsonType.Boolean:
inst_boolean = default (Boolean);
inst_boolean = default (bool);
break;
}

View File

@@ -96,21 +96,21 @@ namespace LitJson
IDictionary<Type, ImporterFunc>> custom_importers_table;
private static IDictionary<Type, ArrayMetadata> array_metadata;
private static readonly object array_metadata_lock = new Object ();
private static readonly object array_metadata_lock = new object ();
private static IDictionary<Type,
IDictionary<Type, MethodInfo>> conv_ops;
private static readonly object conv_ops_lock = new Object ();
private static readonly object conv_ops_lock = new object ();
private static IDictionary<Type, ObjectMetadata> object_metadata;
private static readonly object object_metadata_lock = new Object ();
private static readonly object object_metadata_lock = new object ();
private static IDictionary<Type,
IList<PropertyMetadata>> type_properties;
private static readonly object type_properties_lock = new Object ();
private static readonly object type_properties_lock = new object ();
private static JsonWriter static_writer;
private static readonly object static_writer_lock = new Object ();
private static readonly object static_writer_lock = new object ();
#endregion
@@ -346,7 +346,7 @@ namespace LitJson
new object[] { reader.Value });
// No luck
throw new JsonException (String.Format (
throw new JsonException (string.Format (
"Can't assign value '{0}' (type {1}) to type {2}",
reader.Value, json_type, inst_type));
}

View File

@@ -246,7 +246,7 @@ namespace LitJson
number.IndexOf ('E') != -1) {
double n_double;
if (Double.TryParse (number, out n_double)) {
if (double.TryParse (number, out n_double)) {
Token = JsonToken.Double;
Value = n_double;
@@ -255,7 +255,7 @@ namespace LitJson
}
int n_int32;
if (Int32.TryParse (number, out n_int32)) {
if (int.TryParse (number, out n_int32)) {
Token = JsonToken.Int;
Value = n_int32;
@@ -263,7 +263,7 @@ namespace LitJson
}
long n_int64;
if (Int64.TryParse (number, out n_int64)) {
if (long.TryParse (number, out n_int64)) {
Token = JsonToken.Long;
Value = n_int64;

View File

@@ -39,7 +39,7 @@ namespace OpenMetaverse.StructuredData
return OSD.FromReal((double)json);
case JsonType.String:
string str = (string)json;
return String.IsNullOrEmpty(str) ? new OSD() : OSD.FromString(str);
return string.IsNullOrEmpty(str) ? new OSD() : OSD.FromString(str);
case JsonType.Array:
OSDArray array = new OSDArray(json.Count);
for (int i = 0; i < json.Count; i++)
@@ -141,7 +141,7 @@ namespace OpenMetaverse.StructuredData
case OSDType.Date:
case OSDType.URI:
string str = osd.AsString();
return String.IsNullOrEmpty(str) ? null : new JsonData(str);
return string.IsNullOrEmpty(str) ? null : new JsonData(str);
case OSDType.UUID:
UUID uuid = osd.AsUUID();

View File

@@ -14,7 +14,7 @@ namespace LitJson
internal enum ParserToken
{
// Lexer tokens
None = System.Char.MaxValue + 1,
None = char.MaxValue + 1,
Number,
True,
False,