diff options
author | csharptest <roger@csharptest.net> | 2012-10-14 11:38:17 -0500 |
---|---|---|
committer | rogerk <devnull@localhost> | 2012-10-14 11:38:17 -0500 |
commit | 7d53c1291202b1b503fb611829514e17fdef053b (patch) | |
tree | de91adbc95c622ba67cbf4600f2eeac56e36aae7 /src/ProtocolBuffers | |
parent | ad73b4250d906757b290a8a53d4544a623a7e0d8 (diff) | |
download | protobuf-7d53c1291202b1b503fb611829514e17fdef053b.tar.gz protobuf-7d53c1291202b1b503fb611829514e17fdef053b.tar.bz2 protobuf-7d53c1291202b1b503fb611829514e17fdef053b.zip |
Refactored SilverlightCompatibility.cs => FrameworkPortability.cs added NewLine const
Diffstat (limited to 'src/ProtocolBuffers')
-rw-r--r-- | src/ProtocolBuffers/CustomSerialization.cs | 8 | ||||
-rw-r--r-- | src/ProtocolBuffers/Descriptors/DescriptorPool.cs | 2 | ||||
-rw-r--r-- | src/ProtocolBuffers/ProtocolBuffers.csproj | 7 | ||||
-rw-r--r-- | src/ProtocolBuffers/ProtocolBuffersLite.csproj | 5 | ||||
-rw-r--r-- | src/ProtocolBuffers/SilverlightCompatibility.cs | 52 | ||||
-rw-r--r-- | src/ProtocolBuffers/TextTokenizer.cs | 10 |
6 files changed, 18 insertions, 66 deletions
diff --git a/src/ProtocolBuffers/CustomSerialization.cs b/src/ProtocolBuffers/CustomSerialization.cs index 22d87379..256f2e67 100644 --- a/src/ProtocolBuffers/CustomSerialization.cs +++ b/src/ProtocolBuffers/CustomSerialization.cs @@ -33,14 +33,14 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
-
-using System;
-using System.Runtime.Serialization;
-
/*
* This entire source file is not supported on the Silverlight platform
*/
#if !SILVERLIGHT && !COMPACT_FRAMEWORK
+
+using System;
+using System.Runtime.Serialization;
+
namespace Google.ProtocolBuffers
{
/*
diff --git a/src/ProtocolBuffers/Descriptors/DescriptorPool.cs b/src/ProtocolBuffers/Descriptors/DescriptorPool.cs index 78f6ef1b..ae819801 100644 --- a/src/ProtocolBuffers/Descriptors/DescriptorPool.cs +++ b/src/ProtocolBuffers/Descriptors/DescriptorPool.cs @@ -167,7 +167,7 @@ namespace Google.ProtocolBuffers.Descriptors }
private static readonly Regex ValidationRegex = new Regex("^[_A-Za-z][_A-Za-z0-9]*$",
- SilverlightCompatibility.CompiledRegexWhereAvailable);
+ FrameworkPortability.CompiledRegexWhereAvailable);
/// <summary>
/// Verifies that the descriptor's name is valid (i.e. it contains
diff --git a/src/ProtocolBuffers/ProtocolBuffers.csproj b/src/ProtocolBuffers/ProtocolBuffers.csproj index bc7211ed..9dbb37ae 100644 --- a/src/ProtocolBuffers/ProtocolBuffers.csproj +++ b/src/ProtocolBuffers/ProtocolBuffers.csproj @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
- <TargetFrameworkClass>CLIENTPROFILE</TargetFrameworkClass>
+ <EnvironmentFlavor>CLIENTPROFILE</EnvironmentFlavor>
+ <EnvironmentTemplate>NET35</EnvironmentTemplate>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
@@ -11,7 +12,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Google.ProtocolBuffers</RootNamespace>
<AssemblyName>Google.ProtocolBuffers</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
@@ -27,6 +28,7 @@ <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoStdLib>true</NoStdLib>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -38,6 +40,7 @@ <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoStdLib>true</NoStdLib>
</PropertyGroup>
<ItemGroup>
diff --git a/src/ProtocolBuffers/ProtocolBuffersLite.csproj b/src/ProtocolBuffers/ProtocolBuffersLite.csproj index 645112ce..d3bd1f84 100644 --- a/src/ProtocolBuffers/ProtocolBuffersLite.csproj +++ b/src/ProtocolBuffers/ProtocolBuffersLite.csproj @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
- <TargetFrameworkClass>CLIENTPROFILE</TargetFrameworkClass>
+ <EnvironmentFlavor>CLIENTPROFILE</EnvironmentFlavor>
+ <EnvironmentTemplate>NET35</EnvironmentTemplate>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
@@ -11,7 +12,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Google.ProtocolBuffers</RootNamespace>
<AssemblyName>Google.ProtocolBuffersLite</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
diff --git a/src/ProtocolBuffers/SilverlightCompatibility.cs b/src/ProtocolBuffers/SilverlightCompatibility.cs deleted file mode 100644 index e4d474b0..00000000 --- a/src/ProtocolBuffers/SilverlightCompatibility.cs +++ /dev/null @@ -1,52 +0,0 @@ -#region Copyright notice and license
-
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc. All rights reserved.
-// http://github.com/jskeet/dotnet-protobufs/
-// Original C++/Java/Python code:
-// http://code.google.com/p/protobuf/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#endregion
-
-using System.Text.RegularExpressions;
-
-namespace Google.ProtocolBuffers
-{
- /// <summary>
- /// Class containing helpful workarounds for Silverlight compatibility
- /// </summary>
- internal static class SilverlightCompatibility
- {
-#if SILVERLIGHT
- internal const RegexOptions CompiledRegexWhereAvailable = RegexOptions.None;
-#else
- internal const RegexOptions CompiledRegexWhereAvailable = RegexOptions.Compiled;
-#endif
- }
-}
\ No newline at end of file diff --git a/src/ProtocolBuffers/TextTokenizer.cs b/src/ProtocolBuffers/TextTokenizer.cs index 22f73223..7fdbd1d6 100644 --- a/src/ProtocolBuffers/TextTokenizer.cs +++ b/src/ProtocolBuffers/TextTokenizer.cs @@ -80,7 +80,7 @@ namespace Google.ProtocolBuffers // Note: atomic groups used to mimic possessive quantifiers in Java in both of these regexes
internal static readonly Regex WhitespaceAndCommentPattern = new Regex("\\G(?>(\\s|(#.*$))+)",
- SilverlightCompatibility.
+ FrameworkPortability.
CompiledRegexWhereAvailable |
RegexOptions.Multiline);
@@ -89,18 +89,18 @@ namespace Google.ProtocolBuffers "\\G[0-9+-](?>[0-9a-zA-Z_.+-]*)|" + // a number
"\\G\"(?>([^\"\\\n\\\\]|\\\\.)*)(\"|\\\\?$)|" + // a double-quoted string
"\\G\'(?>([^\"\\\n\\\\]|\\\\.)*)(\'|\\\\?$)", // a single-quoted string
- SilverlightCompatibility.CompiledRegexWhereAvailable | RegexOptions.Multiline);
+ FrameworkPortability.CompiledRegexWhereAvailable | RegexOptions.Multiline);
private static readonly Regex DoubleInfinity = new Regex("^-?inf(inity)?$",
- SilverlightCompatibility.CompiledRegexWhereAvailable |
+ FrameworkPortability.CompiledRegexWhereAvailable |
RegexOptions.IgnoreCase);
private static readonly Regex FloatInfinity = new Regex("^-?inf(inity)?f?$",
- SilverlightCompatibility.CompiledRegexWhereAvailable |
+ FrameworkPortability.CompiledRegexWhereAvailable |
RegexOptions.IgnoreCase);
private static readonly Regex FloatNan = new Regex("^nanf?$",
- SilverlightCompatibility.CompiledRegexWhereAvailable |
+ FrameworkPortability.CompiledRegexWhereAvailable |
RegexOptions.IgnoreCase);
/** Construct a tokenizer that parses tokens from the given text. */
|