Skip to content

Commit

Permalink
Fix multiple compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eshikafe committed Dec 31, 2023
1 parent f79eea1 commit 1e78e94
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 33 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ members = [

[dependencies]
synfig-core = {path = "synfig-core", version = "0.1.0"}
env_logger = "0.9.1"

1 change: 0 additions & 1 deletion synfig-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2021"
[dependencies]
lazy_static = "1.4.0"
log = "0.4.17"
env_logger = "0.9.1"
guid-create = "0.3.1"
#rayon = "1.8"
#quick-xml = "0.31.0"
Expand Down
8 changes: 4 additions & 4 deletions synfig-core/src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ pub mod gamma;
pub mod pixelformat;

pub struct Color {
r: f64,
g: f64,
b: f64,
a: f64
pub r: f64,
pub g: f64,
pub b: f64,
pub a: f64
}

impl Color {
Expand Down
43 changes: 21 additions & 22 deletions synfig-core/src/loadcanvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ lazy_static! {

// TODO: Replace with a quick_xml crate
mod xmlpp {
#[derive(Debug)]
pub struct Node;
pub type Node = i32;

#[derive(Debug)]
pub struct Element;
Expand Down Expand Up @@ -190,7 +189,7 @@ impl CanvasParser {
node: &xmlpp::Element,
parent: canvas::Handle,
inline_: bool,
identifier: &FileSystem::Identifier,
//identifier: &FileSystem::Identifier,
path: String,
) -> canvas::Handle {
// parent = 0;
Expand Down Expand Up @@ -221,7 +220,7 @@ impl CanvasParser {
}

// Generic Value Base Parsing Function
fn parse_value(&mut self, node: &xmlpp::Element, canvas: canvas::Handle) -> ValueBase {
fn parse_value(&mut self, node: &xmlpp::Element, canvas: canvas::Handle) -> i32 /* ValueBase */ {
0
}

Expand Down Expand Up @@ -265,7 +264,7 @@ impl CanvasParser {
}

// Angle Value Base Parsing Function
fn parse_angle(&mut self, node: &xmlpp::Element) -> Angle {
fn parse_angle(&mut self, node: &xmlpp::Element) -> i32 /* Angle */ {
0
}

Expand All @@ -280,47 +279,47 @@ impl CanvasParser {
}

// Segment Value Base Parsing Function
fn parse_segment(&mut self, node: &xmlpp::Element) -> Segment {
fn parse_segment(&mut self, node: &xmlpp::Element) -> i32 /* Segment */ {
0
}

// List Value Base Parsing Function
fn parse_list(&mut self, node: &xmlpp::Element, canvas: canvas::Handle) -> ValueBase {
fn parse_list(&mut self, node: &xmlpp::Element, canvas: canvas::Handle) -> i32 /* ValueBase */ {
0
}

// Weighted Value Base Parsing Function
fn parse_weighted_value(
&mut self,
node: &xmlpp::Element,
_type: &types_namespace::TypeWeightedValueBase,
// _type: &types_namespace::TypeWeightedValueBase,
canvas: canvas::Handle,
) -> ValueBase {
) -> i32 /* ValueBase */ {
0
}

// Pair Value Base Parsing Function
fn parse_pair(
&mut self,
node: &xmlpp::Element,
_type: &types_namespace::TypePairBase,
// _type: &types_namespace::TypePairBase,
canvas: canvas::Handle,
) -> ValueBase {
) -> i32 /* ValueBase */ {
0
}

// Gradient Value Base Parsing Function
fn parse_gradient(&mut self, node: &xmlpp::Element) -> Gradient {
fn parse_gradient(&mut self, node: &xmlpp::Element) -> i32 /* Gradient */ {
0
}

// Bline Point Value Base Parsing Function
fn parse_bline_point(&mut self, node: &xmlpp::Element) -> BLinePoint {
fn parse_bline_point(&mut self, node: &xmlpp::Element) -> i32 /* BLinePoint */ {
0
}

// Transformation Value Base Parsing Function
fn parse_transformation(&mut self, node: &xmlpp::Element) -> Transformation {
fn parse_transformation(&mut self, node: &xmlpp::Element) -> i32 /* Transformation */ {
0
}

Expand All @@ -329,17 +328,17 @@ impl CanvasParser {
}

/// Width Point Value Base Parsing Function
fn parse_width_point(&mut self, node: &xmlpp::Element) -> WidthPoint {
fn parse_width_point(&mut self, node: &xmlpp::Element) -> i32 /* WidthPoint */ {
0
}

// Dash Item Value Base Parsing Function
fn parse_dash_item(&mut self, node: &xmlpp::Element) -> DashItem {
fn parse_dash_item(&mut self, node: &xmlpp::Element) -> i32 /* DashItem */ {
0
}

// Keyframe Parsing Function
fn parse_keyframe(&mut self, node: &xmlpp::Element, canvas: canvas::Handle) -> Keyframe {
fn parse_keyframe(&mut self, node: &xmlpp::Element, canvas: canvas::Handle) -> i32 /* Keyframe */ {
0
}

Expand All @@ -348,7 +347,7 @@ impl CanvasParser {
&mut self,
node: &xmlpp::Element,
canvas: canvas::Handle,
) -> etl::handle<ValueNode_Animated> {
) -> i32 /* etl::handle<ValueNode_Animated> */ {
0
}

Expand All @@ -357,7 +356,7 @@ impl CanvasParser {
&mut self,
node: &xmlpp::Element,
canvas: canvas::Handle,
) -> etl::handle<LinkableValueNode> {
) -> i32 /*etl::handle<LinkableValueNode>*/ {
0
}

Expand All @@ -366,7 +365,7 @@ impl CanvasParser {
&mut self,
node: &xmlpp::Element,
canvas: canvas::Handle,
) -> etl::handle<ValueNode_StaticList> {
) -> i32 /* etl::handle<ValueNode_StaticList> */ {
0
}

Expand All @@ -375,12 +374,12 @@ impl CanvasParser {
&mut self,
node: &xmlpp::Element,
canvas: canvas::Handle,
) -> etl::handle<ValueNode_DynamicList> {
) -> i32 /* etl::handle<ValueNode_DynamicList> */ {
0
}

// Interpolation option for ValueBase parsing function
fn parse_interpolation(&mut self, node: &xmlpp::Element, attribute: String) -> Interpolation {
fn parse_interpolation(&mut self, node: &xmlpp::Element, attribute: String) -> i32 /* Interpolation */ {
0
}

Expand Down
1 change: 1 addition & 0 deletions synfig-core/src/segment.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

use crate::vector::{Vector, Point};

#[derive(Copy, Clone)]
pub struct Segment
{
p1: Point,
Expand Down
5 changes: 3 additions & 2 deletions synfig-core/src/vector.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use std::ops::Sub;

#[derive(Copy, Clone)]
pub struct Vector {
x: f64,
y: f64,
pub x: f64,
pub y: f64,
}

pub type Point = Vector;
Expand Down
1 change: 1 addition & 0 deletions tests/loadcanvas_test.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

use synfig_core::{loadcanvas::*, version::*};

#[test]
Expand Down
8 changes: 4 additions & 4 deletions tests/uniqueid_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ fn test_id() {
let a1 = UniqueID::new(Some(1000));
let a2 = UniqueID::new(Some(1000));
let a3 = UniqueID::new(Some(999));
let b = UniqueID::new(None);
let _b = UniqueID::new(None);

assert!(a1, a2);
assert_lt!(a3, a1);
assert_eq!(a1, a2);
assert_ne!(a3, a1);

assert_eq!(a1.get_uid(), 1000);

let a4 = a1.nill();
let a4 = a2.nil();
assert_eq!(a4.get_uid(), 0);

}

0 comments on commit 1e78e94

Please sign in to comment.