OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [runtime/] [go-map-len.c] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
/* go-map-len.c -- return the length of a map.
2
 
3
   Copyright 2009 The Go Authors. All rights reserved.
4
   Use of this source code is governed by a BSD-style
5
   license that can be found in the LICENSE file.  */
6
 
7
#include <stddef.h>
8
 
9
#include "go-assert.h"
10
#include "map.h"
11
 
12
/* Return the length of a map.  This could be done inline, of course,
13
   but I'm doing it as a function for now to make it easy to change
14
   the map structure.  */
15
 
16
int
17
__go_map_len (struct __go_map *map)
18
{
19
  if (map == NULL)
20
    return 0;
21
  __go_assert (map->__element_count == (uintptr_t) (int) map->__element_count);
22
  return map->__element_count;
23
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.