mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-21 11:11:37 +00:00
[gatest] Fix use of uninitialized multivector components
I guess I had forgotten that new_mv() does *NOT* initialize the components. Things just happened to work (usually) because memory was not getting recycled.
This commit is contained in:
parent
68ca8c7016
commit
2858870153
1 changed files with 7 additions and 7 deletions
|
@ -106,7 +106,7 @@ static MultiVector *new_mv (Algebra *algebra, BasisLayout *layout)
|
|||
|
||||
-(MultiVector *) product:(MultiVector *) rhs
|
||||
{
|
||||
MultiVector *prod = new_mv (algebra, nil);
|
||||
MultiVector *prod = [MultiVector new:algebra];
|
||||
for (int i = 0; i < num_components; i++) {
|
||||
if (!components[i]) {
|
||||
continue;
|
||||
|
@ -144,7 +144,7 @@ static MultiVector *new_mv (Algebra *algebra, BasisLayout *layout)
|
|||
|
||||
-(MultiVector *) wedge:(MultiVector *) rhs
|
||||
{
|
||||
MultiVector *prod = new_mv (algebra, nil);
|
||||
MultiVector *prod = [MultiVector new:algebra];
|
||||
for (int i = 0; i < num_components; i++) {
|
||||
if (!components[i]) {
|
||||
continue;
|
||||
|
@ -171,7 +171,7 @@ static MultiVector *new_mv (Algebra *algebra, BasisLayout *layout)
|
|||
|
||||
-(MultiVector *) dot:(MultiVector *) rhs
|
||||
{
|
||||
MultiVector *prod = new_mv (algebra, nil);
|
||||
MultiVector *prod = [MultiVector new:algebra];
|
||||
for (int i = 0; i < num_components; i++) {
|
||||
if (!components[i]) {
|
||||
continue;
|
||||
|
@ -207,7 +207,7 @@ static MultiVector *new_mv (Algebra *algebra, BasisLayout *layout)
|
|||
|
||||
-(MultiVector *) plus:(MultiVector *) rhs
|
||||
{
|
||||
MultiVector *plus = new_mv (algebra, nil);
|
||||
MultiVector *plus = [MultiVector new:algebra];
|
||||
for (int i = 0; i < num_components; i++) {
|
||||
double c = components[i];
|
||||
if (!c) {
|
||||
|
@ -231,7 +231,7 @@ static MultiVector *new_mv (Algebra *algebra, BasisLayout *layout)
|
|||
|
||||
-(MultiVector *) minus:(MultiVector *) rhs
|
||||
{
|
||||
MultiVector *minus = new_mv (algebra, nil);
|
||||
MultiVector *minus = [MultiVector new:algebra];
|
||||
for (int i = 0; i < num_components; i++) {
|
||||
double c = components[i];
|
||||
if (!c) {
|
||||
|
@ -255,7 +255,7 @@ static MultiVector *new_mv (Algebra *algebra, BasisLayout *layout)
|
|||
|
||||
-(MultiVector *) dual
|
||||
{
|
||||
MultiVector *dual = new_mv (algebra, nil);
|
||||
MultiVector *dual = [MultiVector new:algebra];
|
||||
unsigned dual_mask = (1 << [algebra dimension]) - 1;
|
||||
for (int i = 0; i < num_components; i++) {
|
||||
if (!components[i]) {
|
||||
|
@ -273,7 +273,7 @@ static MultiVector *new_mv (Algebra *algebra, BasisLayout *layout)
|
|||
|
||||
-(MultiVector *) reverse
|
||||
{
|
||||
MultiVector *reverse = new_mv (algebra, nil);
|
||||
MultiVector *reverse = [MultiVector new:algebra];
|
||||
for (int i = 0; i < num_components; i++) {
|
||||
if (!components[i]) {
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue