Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
6716432c
Commit
6716432c
authored
Oct 14, 2012
by
csharptest
Committed by
rogerk
Oct 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Last (hopefully) changes to pre-processing directives
parent
0f56b842
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
34 additions
and
55 deletions
+34
-55
Microsoft.VisualStudio.TestTools.cs
lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs
+1
-1
SerializableAttribute.cs
src/ProtocolBuffers.Test/SerializableAttribute.cs
+1
-1
CodedInputStream.cs
src/ProtocolBuffers/CodedInputStream.cs
+1
-16
CodedOutputStream.cs
src/ProtocolBuffers/CodedOutputStream.cs
+1
-21
CustomSerialization.cs
src/ProtocolBuffers/CustomSerialization.cs
+1
-1
FrameworkPortability.cs
src/ProtocolBuffers/FrameworkPortability.cs
+22
-0
ProtocolBuffersLite.Test.csproj
src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj
+3
-1
ProtocolBuffersLiteMixed.Test.csproj
...ocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj
+3
-1
SerializableAttribute.cs
src/ProtocolBuffersLite.Test/SerializableAttribute.cs
+0
-12
SerializableLiteTest.cs
src/ProtocolBuffersLite.Test/SerializableLiteTest.cs
+1
-1
No files found.
lib/NUnit-config/Microsoft.VisualStudio.TestTools.cs
View file @
6716432c
using
System
;
#if
!SILVERLIGHT && !COMPACT_FRAMEWORK
#if
CLIENTPROFILE
namespace
Microsoft.VisualStudio.TestTools.UnitTesting
{
[
AttributeUsage
(
AttributeTargets
.
Class
,
Inherited
=
true
,
AllowMultiple
=
false
)]
...
...
src/ProtocolBuffers.Test/SerializableAttribute.cs
View file @
6716432c
#
if
SILVERLIGHT
#
if
NOSERIALIZABLE
&&
!
COMPACT_FRAMEWORK
namespace
System
{
...
...
src/ProtocolBuffers/CodedInputStream.cs
View file @
6716432c
...
...
@@ -231,22 +231,7 @@ namespace Google.ProtocolBuffers
/// </summary>
public
bool
ReadDouble
(
ref
double
value
)
{
#if SILVERLIGHT || COMPACT_FRAMEWORK
if
(
BitConverter
.
IsLittleEndian
&&
8
<=
bufferSize
-
bufferPos
)
{
value
=
BitConverter
.
ToDouble
(
buffer
,
bufferPos
);
bufferPos
+=
8
;
}
else
{
byte
[]
rawBytes
=
ReadRawBytes
(
8
);
if
(!
BitConverter
.
IsLittleEndian
)
ByteArray
.
Reverse
(
rawBytes
);
value
=
BitConverter
.
ToDouble
(
rawBytes
,
0
);
}
#else
value
=
BitConverter
.
Int64BitsToDouble
((
long
)
ReadRawLittleEndian64
());
#endif
value
=
FrameworkPortability
.
Int64ToDouble
((
long
)
ReadRawLittleEndian64
());
return
true
;
}
...
...
src/ProtocolBuffers/CodedOutputStream.cs
View file @
6716432c
...
...
@@ -496,27 +496,7 @@ namespace Google.ProtocolBuffers
/// </summary>
public
void
WriteDoubleNoTag
(
double
value
)
{
#if SILVERLIGHT || COMPACT_FRAMEWORK
byte
[]
rawBytes
=
BitConverter
.
GetBytes
(
value
);
if
(!
BitConverter
.
IsLittleEndian
)
ByteArray
.
Reverse
(
rawBytes
);
if
(
limit
-
position
>=
8
)
{
buffer
[
position
++]
=
rawBytes
[
0
];
buffer
[
position
++]
=
rawBytes
[
1
];
buffer
[
position
++]
=
rawBytes
[
2
];
buffer
[
position
++]
=
rawBytes
[
3
];
buffer
[
position
++]
=
rawBytes
[
4
];
buffer
[
position
++]
=
rawBytes
[
5
];
buffer
[
position
++]
=
rawBytes
[
6
];
buffer
[
position
++]
=
rawBytes
[
7
];
}
else
WriteRawBytes
(
rawBytes
,
0
,
8
);
#else
WriteRawLittleEndian64
((
ulong
)
BitConverter
.
DoubleToInt64Bits
(
value
));
#endif
WriteRawLittleEndian64
((
ulong
)
FrameworkPortability
.
DoubleToInt64
(
value
));
}
/// <summary>
...
...
src/ProtocolBuffers/CustomSerialization.cs
View file @
6716432c
...
...
@@ -34,7 +34,7 @@
#endregion
/*
* This entire source file is not supported on
the Silverlight
platform
* This entire source file is not supported on
some
platform
*/
#if !NOSERIALIZABLE
...
...
src/ProtocolBuffers/FrameworkPortability.cs
View file @
6716432c
...
...
@@ -63,6 +63,28 @@ namespace Google.ProtocolBuffers
get
{
return
CultureInfo
.
InvariantCulture
;
}
}
internal
static
double
Int64ToDouble
(
long
value
)
{
#if CLIENTPROFILE
return
BitConverter
.
Int64BitsToDouble
(
value
);
#else
double
[]
arresult
=
new
double
[
1
];
Buffer
.
BlockCopy
(
new
[]
{
value
},
0
,
arresult
,
0
,
8
);
return
arresult
[
0
];
#endif
}
internal
static
long
DoubleToInt64
(
double
value
)
{
#if CLIENTPROFILE
return
BitConverter
.
DoubleToInt64Bits
(
value
);
#else
long
[]
arresult
=
new
long
[
1
];
Buffer
.
BlockCopy
(
new
[]
{
value
},
0
,
arresult
,
0
,
8
);
return
arresult
[
0
];
#endif
}
internal
static
bool
TryParseInt32
(
string
text
,
out
int
number
)
{
return
TryParseInt32
(
text
,
NumberStyles
.
Any
,
InvariantCulture
,
out
number
);
...
...
src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj
View file @
6716432c
...
...
@@ -69,6 +69,9 @@
<Compile
Include=
"..\ProtocolBuffers.Test\Properties\AssemblyInfo.cs"
>
<Link>
Properties\AssemblyInfo.cs
</Link>
</Compile>
<Compile
Include=
"..\ProtocolBuffers.Test\SerializableAttribute.cs"
>
<Link>
SerializableAttribute.cs
</Link>
</Compile>
<Compile
Include=
"..\ProtocolBuffers.Test\TestRpcForMimeTypes.cs"
>
<Link>
TestRpcForMimeTypes.cs
</Link>
</Compile>
...
...
@@ -80,7 +83,6 @@
<Compile
Include=
"ExtendableBuilderLiteTest.cs"
/>
<Compile
Include=
"ExtendableMessageLiteTest.cs"
/>
<Compile
Include=
"LiteTest.cs"
/>
<Compile
Include=
"SerializableAttribute.cs"
/>
<Compile
Include=
"SerializableLiteTest.cs"
/>
<Compile
Include=
"TestLiteByApi.cs"
/>
<Compile
Include=
"TestProtos\UnitTestExtrasLiteProtoFile.cs"
/>
...
...
src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj
View file @
6716432c
...
...
@@ -69,6 +69,9 @@
<Compile
Include=
"..\ProtocolBuffers.Test\Properties\AssemblyInfo.cs"
>
<Link>
Properties\AssemblyInfo.cs
</Link>
</Compile>
<Compile
Include=
"..\ProtocolBuffers.Test\SerializableAttribute.cs"
>
<Link>
SerializableAttribute.cs
</Link>
</Compile>
<Compile
Include=
"AbstractBuilderLiteTest.cs"
/>
<Compile
Include=
"AbstractMessageLiteTest.cs"
/>
<Compile
Include=
"ExtendableBuilderLiteTest.cs"
/>
...
...
@@ -76,7 +79,6 @@
<Compile
Include=
"InteropLiteTest.cs"
/>
<Compile
Include=
"LiteTest.cs"
/>
<Compile
Include=
"MissingFieldAndExtensionTest.cs"
/>
<Compile
Include=
"SerializableAttribute.cs"
/>
<Compile
Include=
"TestLiteByApi.cs"
/>
<Compile
Include=
"TestProtos\UnitTestExtrasFullProtoFile.cs"
/>
<Compile
Include=
"TestProtos\UnitTestExtrasLiteProtoFile.cs"
/>
...
...
src/ProtocolBuffersLite.Test/SerializableAttribute.cs
deleted
100644 → 0
View file @
0f56b842
#
if
SILVERLIGHT
namespace
System
{
[
AttributeUsage
(
AttributeTargets
.
Class
)]
public
class
SerializableAttribute
:
Attribute
{
public
SerializableAttribute
()
:
base
()
{
}
}
}
#endif
src/ProtocolBuffersLite.Test/SerializableLiteTest.cs
View file @
6716432c
using
System
;
#if !
SILVERLIGHT && !COMPACT_FRAMEWORK
#if !
NOSERIALIZABLE
using
System.Collections.Generic
;
using
System.IO
;
using
System.Runtime.Serialization
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment