mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 20:58:15 +00:00
Merge tag 'dev-2025-11'
This commit is contained in:
@@ -130,9 +130,9 @@ tag_time_unmarshal :: proc(_: ^Tag_Implementation, d: Decoder, _: Tag_Number, v:
|
||||
case .U8, .U16, .U32, .U64, .Neg_U8, .Neg_U16, .Neg_U32, .Neg_U64:
|
||||
switch &dst in v {
|
||||
case time.Time:
|
||||
i: i64
|
||||
_unmarshal_any_ptr(d, &i, hdr) or_return
|
||||
dst = time.unix(i64(i), 0)
|
||||
secs: i64
|
||||
_unmarshal_any_ptr(d, &secs, hdr) or_return
|
||||
dst = time.unix(i64(secs), 0)
|
||||
return
|
||||
case:
|
||||
return _unmarshal_value(d, v, hdr)
|
||||
@@ -152,19 +152,23 @@ tag_time_unmarshal :: proc(_: ^Tag_Implementation, d: Decoder, _: Tag_Number, v:
|
||||
|
||||
case:
|
||||
maj, add := _header_split(hdr)
|
||||
if maj == .Other {
|
||||
i := _decode_tiny_u8(add) or_return
|
||||
|
||||
switch &dst in v {
|
||||
case time.Time:
|
||||
dst = time.unix(i64(i), 0)
|
||||
case:
|
||||
if _assign_int(v, i) { return }
|
||||
}
|
||||
secs: u8
|
||||
#partial switch maj {
|
||||
case .Unsigned:
|
||||
secs = _decode_tiny_u8(add) or_return
|
||||
case .Other:
|
||||
secs = u8(_decode_tiny_simple(add) or_return)
|
||||
case:
|
||||
return .Bad_Tag_Value
|
||||
}
|
||||
|
||||
// Only numbers and floats are allowed in this tag.
|
||||
return .Bad_Tag_Value
|
||||
switch &dst in v {
|
||||
case time.Time:
|
||||
dst = time.unix(i64(secs), 0)
|
||||
return
|
||||
case:
|
||||
if _assign_int(v, secs) { return }
|
||||
}
|
||||
}
|
||||
|
||||
return _unsupported(v, hdr)
|
||||
|
||||
@@ -15,7 +15,7 @@ package encoding_unicode_entity
|
||||
|
||||
/*
|
||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||
Made available under Odin's BSD-3 license.
|
||||
Made available under Odin's license.
|
||||
|
||||
List of contributors:
|
||||
Jeroen van Rijn: Initial implementation.
|
||||
|
||||
+14
-25
@@ -1,28 +1,17 @@
|
||||
BSD 3-Clause License
|
||||
Copyright (c) 2024-2025 Feoramund, Ginger Bill. All rights reserved.
|
||||
|
||||
Copyright (c) 2024, Feoramund
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. Neither the name of the copyright holder 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 HOLDER 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.
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
@@ -2,7 +2,7 @@ package encoding_varint
|
||||
|
||||
/*
|
||||
Copyright 2022 Jeroen van Rijn <nom@duclavier.com>.
|
||||
Made available under Odin's BSD-3 license.
|
||||
Made available under Odin's license.
|
||||
|
||||
List of contributors:
|
||||
Jeroen van Rijn: Initial implementation.
|
||||
|
||||
@@ -4,7 +4,7 @@ package encoding_xml
|
||||
An XML 1.0 / 1.1 parser
|
||||
|
||||
Copyright 2021-2022 Jeroen van Rijn <nom@duclavier.com>.
|
||||
Made available under Odin's BSD-3 license.
|
||||
Made available under Odin's license.
|
||||
|
||||
A from-scratch XML implementation, loosely modeled on the [spec](https://www.w3.org/TR/2006/REC-xml11-20060816).
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ package encoding_xml
|
||||
An XML 1.0 / 1.1 parser
|
||||
|
||||
Copyright 2021-2022 Jeroen van Rijn <nom@duclavier.com>.
|
||||
Made available under Odin's BSD-3 license.
|
||||
Made available under Odin's license.
|
||||
|
||||
This file contains helper functions.
|
||||
*/
|
||||
|
||||
@@ -4,7 +4,7 @@ package encoding_xml
|
||||
An XML 1.0 / 1.1 parser
|
||||
|
||||
Copyright 2021-2022 Jeroen van Rijn <nom@duclavier.com>.
|
||||
Made available under Odin's BSD-3 license.
|
||||
Made available under Odin's license.
|
||||
|
||||
A from-scratch XML implementation, loosely modeled on the [spec](https://www.w3.org/TR/2006/REC-xml11-20060816).
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package encoding_xml
|
||||
An XML 1.0 / 1.1 parser
|
||||
|
||||
2021-2022 Jeroen van Rijn <nom@duclavier.com>.
|
||||
available under Odin's BSD-3 license.
|
||||
available under Odin's license.
|
||||
|
||||
List of contributors:
|
||||
- Jeroen van Rijn: Initial implementation.
|
||||
|
||||
Reference in New Issue
Block a user