Skip to content

Commit

Permalink
convert aa.c to aarray.d
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Oct 14, 2018
1 parent 54b676b commit e329eea
Show file tree
Hide file tree
Showing 7 changed files with 632 additions and 278 deletions.
6 changes: 5 additions & 1 deletion src/dmd/backend/aa.c
Expand Up @@ -2,7 +2,7 @@
* Compiler implementation of the
* $(LINK2 http://www.dlang.org, D programming language).
*
* Copyright: Copyright (C) 2000-2018 by The D Language Foundation, All Rights Reserved
* Copyright: Copyright (c) 2000-2017 by Digital Mars, All Rights Reserved
* Authors: $(LINK2 http://www.digitalmars.com, Walter Bright)
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/backend/aa.c, backend/aa.c)
Expand All @@ -14,6 +14,8 @@
#include <string.h>
#include <assert.h>

#if 0

#include "tinfo.h"
#include "aa.h"

Expand Down Expand Up @@ -507,3 +509,5 @@ int AArray::apply_x(aaA* e, dg2_t dg, size_t aligned_keysize, void *parameter)

return result;
}

#endif
20 changes: 20 additions & 0 deletions src/dmd/backend/aa.h
Expand Up @@ -12,6 +12,25 @@
#ifndef AA_H
#define AA_H

#if 1

struct AAchars
{
static AAchars* create();
static void destroy(AAchars*);
uint* get(const char *s, unsigned len);
uint length();
};

struct AApair
{
static AApair* create(unsigned char** pbase);
static void destroy(AApair*);
uint* get(uint start, uint end);
uint length();
};

#else
#include <stdlib.h>
#include "tinfo.h"
Expand Down Expand Up @@ -106,4 +125,5 @@ struct AArray
};
#endif
#endif

0 comments on commit e329eea

Please sign in to comment.