Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
ca588a73
Commit
ca588a73
authored
17 years ago
by
Martin Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Trying out protected instead of static to see how it looks and feels...
Rev: lib/modules/ADT.pmod/BitBuffer.pike:1.9
parent
021a2de1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/ADT.pmod/BitBuffer.pike
+8
-8
8 additions, 8 deletions
lib/modules/ADT.pmod/BitBuffer.pike
with
8 additions
and
8 deletions
lib/modules/ADT.pmod/BitBuffer.pike
+
8
−
8
View file @
ca588a73
//
//
// $Id: BitBuffer.pike,v 1.
8
200
5/01/04 08:10:14
nilsson Exp $
// $Id: BitBuffer.pike,v 1.
9
200
7/10/06 13:43:41
nilsson Exp $
//! Implements a FIFO bit buffer, i.e. a buffer that operates on bits
//! Implements a FIFO bit buffer, i.e. a buffer that operates on bits
//! instead of bytes. It is not designed for performance, but as a way
//! instead of bytes. It is not designed for performance, but as a way
...
@@ -22,11 +22,11 @@
...
@@ -22,11 +22,11 @@
#pike __REAL_VERSION__
#pike __REAL_VERSION__
static
string data = "";
protected
string data = "";
static
int dptr;
protected
int dptr;
//! The buffer can be initialized with initial data during creation.
//! The buffer can be initialized with initial data during creation.
void create(void|string _data) {
protected
void create(void|string _data) {
if(_data) feed(_data);
if(_data) feed(_data);
}
}
...
@@ -59,7 +59,7 @@ string drain() {
...
@@ -59,7 +59,7 @@ string drain() {
return d;
return d;
}
}
static
int out_buffer, bib;
protected
int out_buffer, bib;
//! Get @[bits] from the buffer.
//! Get @[bits] from the buffer.
//! @throws
//! @throws
...
@@ -106,7 +106,7 @@ string read( void|int bytes )
...
@@ -106,7 +106,7 @@ string read( void|int bytes )
return (string)buf;
return (string)buf;
}
}
static
int in_buffer, bob;
protected
int in_buffer, bob;
//! Put @[bits] number of bits with the value @[value] into the
//! Put @[bits] number of bits with the value @[value] into the
//! buffer.
//! buffer.
...
@@ -176,11 +176,11 @@ this_program put1( int bits ) {
...
@@ -176,11 +176,11 @@ this_program put1( int bits ) {
}
}
//! @[sizeof()] will return the number of bits in the buffer.
//! @[sizeof()] will return the number of bits in the buffer.
int _sizeof() {
protected
int _sizeof() {
return sizeof(data)*8+bib+bob-dptr*8;
return sizeof(data)*8+bib+bob-dptr*8;
}
}
string _sprintf(int t) {
protected
string _sprintf(int t) {
if(t!='O') return UNDEFINED;
if(t!='O') return UNDEFINED;
string ret = sprintf("%O(", this_program);
string ret = sprintf("%O(", this_program);
if(bib) ret += reverse(sprintf("%0"+bib+"b", out_buffer));
if(bib) ret += reverse(sprintf("%0"+bib+"b", out_buffer));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment