nitpicker: Remove local string.h

This commit is contained in:
Norman Feske 2013-09-07 12:14:52 +02:00
parent a6c019e0c6
commit 74242c0906
4 changed files with 4 additions and 40 deletions

View File

@ -55,7 +55,7 @@ static void draw_frame(Canvas &canvas, Rect r, Color color, int frame_size)
void View::title(const char *title)
{
Nitpicker::strncpy(_title, title, TITLE_LEN);
Genode::strncpy(_title, title, TITLE_LEN);
/* calculate label size, the position is defined by the view stack */
_label_rect = Rect(Point(0, 0), label_size(_session.label(), _title));

View File

@ -16,9 +16,7 @@
/* Genode includes */
#include <util/list.h>
/* local includes */
#include "string.h"
#include <util/string.h>
class Texture;
class View;
@ -70,7 +68,7 @@ class Session : public Session_list::Element
:
_color(color), _texture(texture), _background(0),
_v_offset(v_offset), _input_mask(input_mask), _stay_top(stay_top) {
Nitpicker::strncpy(_label, label, sizeof(_label)); }
Genode::strncpy(_label, label, sizeof(_label)); }
virtual ~Session() { }

View File

@ -1,34 +0,0 @@
/*
* \brief Nitpicker string functions
* \author Norman Feske
* \date 2006-08-09
*
* These custom versions of standard string functions are provided
* to make Nitpicker independent from the C library. Note that the
* functions are not 100% compatible with their libC counterparts.
*/
/*
* Copyright (C) 2006-2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _STRING_H_
#define _STRING_H_
namespace Nitpicker {
inline void strncpy(char *dst, const char *src, unsigned n)
{
unsigned i;
for (i = 0; (i + 1 < n) && src[i]; i++)
dst[i] = src[i];
/* null-terminate string */
if (n > 0) dst[i] = 0;
}
}
#endif

View File

@ -14,12 +14,12 @@
#ifndef _VIEW_H_
#define _VIEW_H_
#include <util/string.h>
#include <nitpicker_gfx/canvas.h>
#include <nitpicker_gfx/geometry.h>
#include "list.h"
#include "mode.h"
#include "string.h"
#include "session.h"
class Buffer;