Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added GapFFE type #109

Merged
merged 1 commit into from
Oct 31, 2018
Merged

Added GapFFE type #109

merged 1 commit into from
Oct 31, 2018

Conversation

sebasguts
Copy link
Contributor

Currently, this causes me severe trouble in Julia, so WIP

@codecov
Copy link

codecov bot commented Oct 30, 2018

Codecov Report

Merging #109 into master will decrease coverage by 0.02%.
The diff coverage is 63.15%.

@@            Coverage Diff             @@
##           master     #109      +/-   ##
==========================================
- Coverage   51.65%   51.62%   -0.03%     
==========================================
  Files          42       42              
  Lines        2536     2549      +13     
==========================================
+ Hits         1310     1316       +6     
- Misses       1226     1233       +7
Impacted Files Coverage Δ
JuliaInterface/julia/gaptypes.jl 96% <ø> (ø) ⬆️
JuliaInterface/src/JuliaInterface.h 100% <ø> (ø) ⬆️
LibGAP.jl/src/gap.jl 21.42% <ø> (ø) ⬆️
JuliaInterface/read.g 92.3% <100%> (+0.64%) ⬆️
JuliaInterface/src/JuliaInterface.c 89.61% <61.11%> (-1.34%) ⬇️
JuliaExperimental/init.g 100% <0%> (ø) ⬆️

@sebasguts sebasguts changed the title WIP: Added GapFFE type Added GapFFE type Oct 30, 2018
@sebasguts sebasguts requested a review from fingolfin October 30, 2018 17:44
JuliaInterface/src/JuliaInterface.c Show resolved Hide resolved
@@ -1,13 +1,14 @@
#include "libgap-api.h"

jl_module_t* get_module_from_string(char*);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, doesn't this PR remove get_module_from_string ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it just moves it all the way to the top.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, but then why is this decl needed, considering that the function implementation now is moved to before the #include "gap_macros.c"?

}

Obj Func_InitializeGAPFFEType(){
JULIA_GAPFFE_type = (jl_datatype_t*)jl_new_datatype(jl_symbol("GapFFE"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why that cast for the return value? It's not needed, is it?

jl_emptysvec,
jl_svec(1,jl_symbol("ptr")),
jl_svec(1,jl_voidpointer_type),
0,0,1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though some more about this, and I now think it would be better to create a primitive type instead, using jl_new_primitivetype -- because what you are stuffing into instances of this type are bits which do not form valid jl_value_t pointers, but rather are pure bits.
So roughly this:

jl_value_t *name = (jl_value_t*)jl_symbol("GapFFE");
jl_module_t *module = get_module_from_string("GAP");
JULIA_GAPFFE_type = jl_new_primitivetype(name, module, jl_any_type, jl_emptysvec, 8 * sizeof(Obj));
jl_set_const(module, name, JULIA_GAPFFE_type);

@sebasguts
Copy link
Contributor Author

I adressed all the changes, and made GAPFFE a primitve type.

@@ -1,13 +1,14 @@
#include "libgap-api.h"

jl_module_t* get_module_from_string(char*);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, but then why is this decl needed, considering that the function implementation now is moved to before the #include "gap_macros.c"?

JuliaInterface/src/gap_macros.c Outdated Show resolved Hide resolved
JuliaInterface/julia/gaptypes.jl Outdated Show resolved Hide resolved
JuliaInterface/julia/gaptypes.jl Outdated Show resolved Hide resolved
JuliaInterface/read.g Show resolved Hide resolved
JuliaInterface/src/JuliaInterface.c Show resolved Hide resolved
JuliaInterface/src/JuliaInterface.c Show resolved Hide resolved
JuliaInterface/src/JuliaInterface.c Outdated Show resolved Hide resolved
fingolfin
fingolfin previously approved these changes Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants